I'm trying to retrieve the url for all lists on the current SharePoint site. I've managed to get the title for each list, I've also found resources explaining how to get the url of one specific list. But my question is how do i get the url of every list on the site. If you take a look at the part url:oList.get_url()
. You'd think there was a method like this to retrive the url from the enumerator, but it does not work.
this.get_lists = function(onSuccess, onFailure, url){
this.setContext(url);
var oWebsite = this.context.get_web();
this.collList = oWebsite.get_lists();
this.context.load(this.collList);
function onSucceed () {
var listEnumerator = this.collList.getEnumerator();
while (listEnumerator.moveNext()){
var oList = listEnumerator.get_current();
var current_oList = {
title:oList.get_title(),
url:oList.get_url()
}
onSuccess(current_oList);
}
}
function onFail(sender, args){
onFailure(args.get_message());
}
this.context.executeQueryAsync(
Function.createDelegate(this, onSucceed),
Function.createDelegate(this, onFail)
);
};