EasyUI Forum

General Category => EasyUI for jQuery => Topic started by: jgautier on January 14, 2014, 03:51:39 AM



Title: Context menu on datagrid ?
Post by: jgautier on January 14, 2014, 03:51:39 AM
Hi,
(sorry for my poor english !)

I use a datagrid, and i'd like to implement a context menu (on right click) on one element of each row.
I know there's onRowContextMenu event, but i'd like not to use it and use a jquery contextmenu plugin instead (this one : http://medialize.github.io/jQuery-contextMenu/)

Is there a way to disable easyui onRowContextMenu event and set it by myself ?

Thanks a lot for your answer.

JG


Title: Re: Context menu on datagrid ?
Post by: stworthy on January 14, 2014, 07:16:44 AM
You can't disable the 'onRowContextMenu' event, but you can bind other 'contentmenu' event or directly display your content menu in 'onRowContextMenu' event.
Code:
$('#dg').datagrid({
  onRowContextMenu:function(e){
    e.preventDefault();
    $("...").contextMenu({x: e.pageX, y: e.pageY});
  }
});


Title: Re: Context menu on datagrid ?
Post by: jgautier on August 10, 2014, 11:57:42 PM
Thanks for your answer.
JG