Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $(document).ready(function() {
- $(document).on("click","a#Ribbon\\.ListItem\\.Manage\\.Delete-Medium",function() {
- debugger;
- if($('a#Ribbon\\.ListItem\\.Manage\\.Delete-Medium:not(.ms-cui-disabled)').length > 0){
- var selectedRows = $('table[summary="TestList"] tr[class*="s4-itm-selected"]');
- for (let item of selectedRows) {
- $.ajax
- ({
- url: _spPageContextInfo.webAbsoluteUrl + "/_api/web/sitegroups/getbyname('SharePointTestGroup')/users/getbyemail('" + item.cells[2].innerText + "')",
- type: "POST",
- headers:
- {
- "Accept": "application/json;odata=verbose",
- "Content-Type": "application/json;odata=verbose",
- "IF-MATCH": "*",
- "X-HTTP-Method": "DELETE",
- "X-RequestDigest": $("#__REQUESTDIGEST").val()
- },
- success: function (data, status, xhr) {
- debugger;
- console.log('deleted');
- },
- error: function (xhr, status, error) {
- debugger;
- console.log("Failed");
- }
- });
- }
- }
- });
- });
Add Comment
Please, Sign In to add comment