EasyUI Forum

General Category => EasyUI for jQuery => Topic started by: amir-t on December 06, 2015, 02:55:02 AM



Title: context-menu in datagrid
Post by: amir-t on December 06, 2015, 02:55:02 AM
hey,

I need to activate the context-menu when right-click on the empty area in the datagrid (not on a selected row).
someone have a suggestion on how to do it?

(http://i66.tinypic.com/opafxi.png)


Title: Re: context-menu in datagrid
Post by: stworthy on December 06, 2015, 09:56:47 PM
Please try this:
Code:
$('#dg').datagrid(
    onRowContextMenu: function(e,index,row){
    if (index>=0){
    console.log('click on rows')
    } else {
    console.log('click out of rows');
    }
    }
)