I want to retrieve subsites from current site collection. And it should be order by last item modified date.
I am able to retrieve subsites by following code :
channel_context = SP.ClientContext.get_current();
channel_web = channel_context.get_web();
channel_context.load(channel_web);
webCollection = channel_web.getSubwebsForCurrentUser(null);
channel_context.load(webCollection)
channel_context.executeQueryAsync(function(){
var temp = "";
var webEnumarator = webCollection.getEnumerator();
var i = 0;
while(webEnumarator.moveNext()){
var curWeb = webEnumarator.get_current();
temp = temp+"<br/>"+curWeb.get_title();
webArray[i] = curWeb.get_title();
i++;
}
document.getElementById("sliderDiv").innerHTML = temp;
}, onSliderImageLoadFailed);
But the webs which I am getting are sort by its title. Which I want to sort by Last Item Modified Date.
Is there any other option for sorting?
Do I have to manually apply some logic for sorting?