dhtmlxMenu appears when you open cell editor. You can configure grid to open cell editor with single click with enableEditEvents() method docs.dhtmlx.com/doku.php?id=dhtm … editevents
on leftclick only contextmenu shall be shown - we don’t want to edit the cell (It is fix with an image in it).
At the moment we have an image in each cell of the first column with a contextmenu on the column.
On rightklick menu with options is shown and logic for opening jsp-pages on click on menu item is implemented.
Only problem ist that it only opens on rightklick.
Here’s a way to show the context menu on left click:
define the menu:
menu = new dhtmlXMenuObject();
menu.renderAsContextMenu();
... add the items
add this prototype:
dhtmlXGridObject.prototype.onClick = function(cb){
var that=this;
dhtmlxEvent(that['obj'],"click",function(e){
var el = that.getFirstParentOfType(_isIE?event.srcElement:e.target,"TD");
var rId = el.parentNode.idd;
var cId = el._cellIndex;
if (rId == undefined || cId == undefined ) {
/// -- write a standard cancel event function or call one app.cancelEvent(e);
return;
}
var v = that.cells(rId, cId).getValue()
cb.apply(that, [rId, cId, v, e]);
})
}
Add the onClick event to the grid and open the menu:
grid.onClick(function(rId, cId, val, e){
if (cId !=0 ) return; // open only on the first cl
window.setTimeout(function(){ menu._doOnContextBeforeCall(e,{id:rId})}, 1)
});
Get a guaranteed answer from DHTMLX technical support team
under the most suitable support plan