Start Building Professional
Web Apps Today


 
Categories Question details Back To List
Question  posted by GR on Mar 20, 2009 14:17
open dhtmlx forum
disable context menu

Im trying to disable a context menu of a grid (pro 2.0). In grid 1.5 this works fine: aMenu.disableMenu(true); but in the new version it is not working. Is it a new function that replace this one?
Answer posted by Alex (support) on Mar 23, 2009 02:19

Grid context menu can be disabled using onBeforeContextMenu event handler. If it returns false, the menu won't be shown.

The following code disables context menu for the second column:

function pre_func(rowId,celIndex,grid){
  if (celIndex==1) return false;
  return true;
}

grid.attachEvent("onBeforeContextMenu",pre_func);