Pages

Thursday, October 30, 2014

Delete list item using SharePoint Client Object Model

function deleteListItem(id){
      var clientContext = SP.ClientContext.get_current();
      var oList = clientContext.get_web().get_lists().getByTitle(list_name);
      this.oListItem = oList.getItemById(id);
      oListItem.deleteObject();
      clientContext.executeQueryAsync(
               Function.createDelegate(this, this.onQuerySucceededs), 
               Function.createDelegate(this, this.onQueryFaileds));  

No comments:

Post a Comment