EasyUI Forum
May 03, 2024, 09:21:03 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: onHeaderContextMenu + enableFilter  (Read 3412 times)
rezzonico
Full Member
***
Posts: 183


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


View Profile Email
« Reply #1 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();
// ...
}

}
Logged
rezzonico
Full Member
***
Posts: 183


View Profile
« Reply #2 on: April 19, 2021, 11:34:14 PM »

Thanks !

Regards
Miche
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!