In a nutshell: Using jquery I want to get some xml output and use it with a custom grid plugin. My problem is in efficiently getting the data I need into the plugin.
That plugin needs to get the count of returned nodes and the rows themselves. Currently I make 2 separate calls to get the xml, one gets it and counts the nodes and returns that number to the plugin, one gets it again sorts the data itself and passes it to the plugin for formatting and display.
So the plugin setup looks something like this:
$("someID").thePlugin({count:countFunction, rows:loadRowsFunction});
where countFunction gets the xml file and counts the nodes and loadRowsFunction ALSO gets the xml file and loads the data. I want to get the xml file once. What is the best way to go about this?