jquery - Can I nest whens? -
working in sharepoint, trying retrieve , process data multiple lists. return second list getting paged, breaks ordering (as far can tell). so, thought literally nest new 'when' second list access must loop gather data returned. generic 'syntax error'. have no clue else try.
this trying (that syntax error):
$.when( retrieveproductdata()) .then( $.when( retrievemilestonedata("https://<myemployersproprietaryurl>")) .then( displayreportdata) .then(function() { $("#processingdiv").hide(); }); );
anybody have suggestions? i'm stuck...
thanks.
more info: both retrieveproductdata , retrievemilestonedata make $.getjson calls proprietary rest urls. i'm passing url retrievemilestonedata, can grab '__next' url returned results, , recurse retrievemilestonedata '__next' url parameter.
displayreportdata needs information both rpd , rmd functions work correctly...
you having not nested .then, 2 .then after eachother. think not correct way.
this should work:
$.when( retrieveproductdata()) .then(function() { $.when( retrievemilestonedata("https://<myemployersproprietaryurl>")) .then(function() { displayreportdata; $("#processingdiv").hide(); }); });
Comments
Post a Comment