I am trying to load a list that exists in multiple subsites in a given site collection. as I enumerate for-each web in the site collection I am loading a particular list by Title.
I am having trouble getting a context to the list being loaded in the callback, however I can see it in the f12 developer tools in the browser.
Can someone give us more info on SP.ClientRequest?
Here is some code:
// other code was redacted
onSummaryListLoad : function (sender, args) {
// want to get a reference to 'summarylist' here from 'sender'
},
onLoadSubWebs : function (sender, args) {
//function () {
console.log('loaded subwebs successfully');
var webs = this.subWebs.getEnumerator();
while (webs.moveNext()) {
var thisWeb = webs.get_current();
console.log(thisWeb.get_title());
this.summarylist = thisWeb.get_lists().getByTitle('Project Summary');
context.load(this.summarylist, "DefaultDisplayFormUrl");
context.executeQueryAsync(Function.createDelegate(this, this.onSummaryListLoad), Function.createDelegate(this, this.APICallFailed));
}
// other code was redacted
Image from the Browser Tools:
Thank!!!!!