ParamQuery grid support forum

General Category => Help for ParamQuery Pro => Topic started by: pranit@srcomsec on March 28, 2023, 03:03:38 pm

Title: Filter dialog "Clear" & "Ok" button click event issue
Post by: pranit@srcomsec on March 28, 2023, 03:03:38 pm
I am trying to add the javascript code below to track "Clear" & "Ok" button click event. The click event is working for "Clear" button but not for "Ok" button. Please advise.

Code: [Select]
$('body').on('click', '#tabs-filter button', function() {     
      console.log('Button clicked!');
});
Title: Re: Filter dialog "Clear" & "Ok" button click event issue
Post by: paramvir on March 29, 2023, 07:05:26 am
try this

Code: [Select]
document.body.addEventListener('click', function(evt){
if(evt.target.nodeName == "BUTTON" && evt.target.closest("#tabs-filter")){
alert("clicked");
}
}, true);
Title: Re: Filter dialog "Clear" & "Ok" button click event issue
Post by: pranit@srcomsec on March 29, 2023, 12:07:01 pm
Thank you, the event is working.

We have multiple dynamic Grid on the same screen using Goldenlayout.

I need the Paramquery Grid ID from where the filter popup opens when the user clicks the "Ok" or "Clear" button. Please advise.
Title: Re: Filter dialog "Clear" & "Ok" button click event issue
Post by: paramvir on March 29, 2023, 03:43:24 pm
It doesn't seem feasible the DOM way because header filter menu is not attached to grid DOM.

Please try the documented beforeFilter and filter events.  Also beforeFilter event doesn't fire when grid.refreshDataAndView() is called  so that can help you differentiate between user initiated filtering and otherwise.
Title: Re: Filter dialog "Clear" & "Ok" button click event issue
Post by: pranit@srcomsec on March 29, 2023, 07:39:20 pm
Thank you. This event helps us to complete our required changes.