Anybody know how to do batch list updates with the javascript client object model in Sharepoint 2010? I'm putting the list into an array right now and then a kendo grid is reading it. I can update the grid and it'd be nice to push the updates back to the list without having to call update or create events on every update.
var context = null,
web = null,
currentUser = null,
menuList = null,
expenseListItems = [],
menuItems;
function getCurrentItems() {
context = SP.ClientContext.get_current();
web = context.get_web();
menuList = web.get_lists().getByTitle('ExpenseReportItems');
var query = SP.CamlQuery.createAllItemsQuery();
menuItems = menuList.getItems(query);
context.load(menuItems, "Include(Title, ID)");
context.executeQueryAsync(onGridLoadSuccess, onFail);
}
function onGridLoadSuccess() {
var listEnum = menuItems.getEnumerator();
while (listEnum.moveNext()) {
var event = listEnum.get_current();
var Title = event.get_item('Title');
var ID = event.get_item('ID');
var expenseData = { title: Title, id: ID };
expenseListItems.push(expenseData);
}
buildGrid(expenseListItems);
}