onContextMenuConfig

fires every time before opening the context menu

void onContextMenuConfig(Event ev);
evEventevent object

Example

webix.ui({
  view:"spreadsheet",
  id:"sheet",
  toolbar:"full",
  data:spreadsheet_data,
  on:{
    onContextMenuConfig:function(ev){
      if (ev.area == "column" || ev.area == "row") return false;
      if (ev.area == "data")
        ev.data = [
          { id:"com-1", group:"myContext", value:"Command 1" },
          { id:"com-2", group:"myContext", value:"Command 2" },
          { id:"com-3", group:"myContext", value:"Command 3" }
        ];
    },
  }
})

Details

Properties of the ev object:

  • area {string} - the area where the click occurred. Can be "column", "row" or "data" depending on where the menu was opened (headers or cells with data).
  • data {object} - the list of menu options.
Back to top