views:

15

answers:

0

In SharePoint 2010 I have a function call where I want to iterate recursively down the the webs using the javascript OM. For this I have to repeatedly call the executeQueryAsync method. For the (success) delegate method I need to pass the collection of the current node level.

I see that the signature of the delegate method has an args parameter, but I don't know how to pass a value to it. Have I missunderstood something here? The msdn docs aren't very helpfull here..

My pseudo code of what I would expect follows:

// the delegate call
kokctx.executeQueryAsync(Function.createDelegate(this, this.getChildNodes), Function.createDelegate(this, this.onQueryFailed));


function getChildNodes(sender, args)
{
    // this is what I want to achieve.. 
    var currentNodeCollection = args.MyPassedArg; 
}