SHARE
TWEET

Untitled

a guest Mar 24th, 2020 22 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. $(document).ready(function() {
  2.    
  3.     $(document).on("click","a#Ribbon\\.ListItem\\.Manage\\.Delete-Medium",function() {
  4.         debugger;
  5.         if($('a#Ribbon\\.ListItem\\.Manage\\.Delete-Medium:not(.ms-cui-disabled)').length > 0){
  6.             var selectedRows = $('table[summary="TestList"] tr[class*="s4-itm-selected"]');
  7.  
  8.             for (let item of selectedRows) {
  9.                 $.ajax
  10.                 ({
  11.                     url: _spPageContextInfo.webAbsoluteUrl + "/_api/web/sitegroups/getbyname('SharePointTestGroup')/users/getbyemail('" + item.cells[2].innerText + "')",
  12.                     type: "POST",
  13.                     headers:
  14.                     {
  15.                         "Accept": "application/json;odata=verbose",
  16.                         "Content-Type": "application/json;odata=verbose",
  17.                         "IF-MATCH": "*",
  18.                         "X-HTTP-Method": "DELETE",
  19.                         "X-RequestDigest": $("#__REQUESTDIGEST").val()
  20.                     },
  21.                     success: function (data, status, xhr) {
  22.                         debugger;
  23.                         console.log('deleted');
  24.                     },
  25.                     error: function (xhr, status, error) {
  26.                         debugger;
  27.                         console.log("Failed");
  28.                     }
  29.                 });
  30.             }
  31.         }  
  32.     });
  33. });
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Top