Saturday, 12 July 2014

SharePoint REST remove item from List

remove: function (id) {
$.ajax(
{
url: _spPageContextInfo.webServerRelativeUrl +
"/_api/web/lists/getByTitle('MyListName')/getItemByStringId('" +
id + "')",
type: "DELETE",
headers: {
"accept": "application/json;odata=verbose",
"X-RequestDigest": $("#__REQUESTDIGEST").val(),
"IF-MATCH":"*"
},
success: function (data) {
REST.Operator.readAll();
},
error: function (err) {
alert(JSON.stringify(err));
}
}
);
}