I am developing a custom ribbon action as Sharepoint hosted app, where the user can select any number of list items and click on the action. On click of the ribbon action, the app redirects to the app landing page where I can fetch the selected item IDs. Now I need to retrieve the respective list items. One of the crude option is to loop the IDs and fetch the list items which I want to avoid.
I tried the batch processing in Javascript object model - use getitembyid method on each item ID, put the result into an array and call the
context.load(array);
This does not seem to work. I thought of creating a camlquery XML in loop for all list items and execute the query once !!
Any suggestions for better approach ?