Kendo Spreadsheet menu: remove merge option

209 views Asked by At

By default in the Telerik Kendo Menu we have copy, paste, cut and merge. Is there a way to remove the "merge" option?

enter image description here

$(document).ready(function () {
    var el = $('#mySpreadSheet');
    var spreadsheet = el.getKendoSpreadsheet();
    spreadsheet.cellContextMenu().remove("?merge?"); // ??
1

There are 1 answers

0
serge On

I post the answer given by telerik team as a ticket:

In order to remove the merge menuitem from the Kendo UI Spreadsheet's contextMenu, utilize the remove method with the specific selector:

$(function() {
    var spreadsheet = $("#spreadsheet").kendoSpreadsheet().data("kendoSpreadsheet"),
        cellContextMenu = spreadsheet.cellContextMenu();
  
  //use a selector to remove a particular item
  cellContextMenu.remove($("ul.k-spreadsheet-cell-context-menu li[data-action='merge']"));
  
  //removes the unneeded separator
  cellContextMenu.remove($("ul.k-spreadsheet-cell-context-menu li.k-menu-separator"));
});

Please take a look at the following Progress Kendo UI Dojo which demonstrates the above and let me know if you have any questions.