EasyUI Forum

General Category => EasyUI for jQuery => Topic started by: rezzonico on April 14, 2021, 12:19:03 PM



Title: onHeaderContextMenu + enableFilter
Post by: rezzonico on April 14, 2021, 12:19:03 PM
Hi,

in my datagrid I use "onHeaderContextMenu" and "enableFilter".
All works as expected.

The only problem is that if I right-click on a "search field" in the datagrid header (in order to paste a search string), the ContextMenu appears.
As a workaround I can use "Ctrl+V".

It would be usesful if the "onHeaderContextMenu" fired only when the user right-clicks on the column names but not when he right-clicks on a "search field".
Is it possible ?


Regards
Miche


Title: Re: onHeaderContextMenu + enableFilter
Post by: jarry on April 16, 2021, 04:20:04 PM
Please try this code.
Code:
onHeaderContextMenu: function(e, field){
if (!$(e.target).closest('.datagrid-filter-row').length){
e.preventDefault();
// ...
}

}


Title: Re: onHeaderContextMenu + enableFilter
Post by: rezzonico on April 19, 2021, 11:34:14 PM
Thanks !

Regards
Miche