Beginning: SharePoint® 2013 Development by Steve Fox & Chris Johnson & Donovan Follette

Beginning: SharePoint® 2013 Development by Steve Fox & Chris Johnson & Donovan Follette

Author:Steve Fox & Chris Johnson & Donovan Follette
Language: eng
Format: epub
Publisher: John Wiley & Sons
Published: 2013-01-24T16:00:00+00:00


20. Run and launch the app again using the Run Project button in the bottom left of the window. This time an alert appears stating, “New ListItems created.”

21. Check the list in the SharePoint site to ensure the data has been created. You should see ten new items created in the list.

22. Within the sharePointReady function, change the createItems(); call to updateListItem();.

23. Directly after the sharePointReady function, insert the following code: var updatedItem; function updateListItem() { var listContext = new SP.AppContextSite(context, hostUrl); var list = listContext.get_web().get_lists().getByTitle('My Sample List'); var listItem = list.getItemById(1); listItem.set_item('Title', 'Updated via JS CSOM'); listItem.update(); context.load(listItem); context.executeQueryAsync(onUpdateItemSucceeded, onFailed); } function onUpdateItemSucceeded() { alert('Updated item!'); }



Download



Copyright Disclaimer:
This site does not store any files on its server. We only index and link to content provided by other sites. Please contact the content providers to delete copyright contents if any and email us, we'll remove relevant links or contents immediately.