Aspose.cells.GridJS - Remove or hide unwanted options from Context menu

Hi Team,

In the Aspose.GridJs Excel editor, we would like to remove unwanted options from the context menu that appears when right-clicking on cells. Please provide the necessary code changes to achieve this in xspreadsheet.js. I’ve attached a file below for reference; please review it and let me know the fixes or solutions that meet our requirements asap.

image.png (83.5 KB)

Thanks,
M.S.Sathish

@parthiveera,

Thanks for the screenshot and details.

We will evaluate your requirements on removing or hiding specified options in the context menu of GridJS. We have opened the following new ticket(s) in our internal issue tracking system and will provide code snippet or supprot your needs according to the terms mentioned in Free Support Policies.

Issue ID(s): CELLSGRIDJS-1345

Once we have an update on it, we will let you know.

@parthiveera
Assume the div id of GridJs is “gridjs-divid”, below is a sample code which deletes the items for “Delete row”,“Hide” and “Link”:

   //get context menus parent dom
   const menus=document.querySelector("#gridjs-divid > div > div.x-spreadsheet-sheet > div.x-spreadsheet-contextmenu");
   var childs = menus.childNodes;
   for (var i = childs.length - 1; i >= 0; i--)
   {  
     // check the item text
     if(childs[i].childNodes[0]?.textContent==="Delete row"||childs[i].childNodes[0]?.textContent==="Link"||childs[i].childNodes[0]?.textContent==="Hide")
       {
         menus.removeChild(childs[i]);
       }
   }