EasyUI Forum
September 13, 2025, 07:37:33 AM *
Welcome, Guest. Please login or register.

Login with username, password and session length
News:
 
   Home   Help Search Login Register  
Pages: [1]
  Print  
Author Topic: Context menu on datagrid ?  (Read 15074 times)
jgautier
Newbie
*
Posts: 20


View Profile
« 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
Logged
stworthy
Administrator
Hero Member
*****
Posts: 3581


View Profile Email
« Reply #1 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});
  }
});
Logged
jgautier
Newbie
*
Posts: 20


View Profile
« Reply #2 on: August 10, 2014, 11:57:42 PM »

Thanks for your answer.
JG
Logged
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines Valid XHTML 1.0! Valid CSS!