-
-
Notifications
You must be signed in to change notification settings - Fork 4.4k
Description
Description
I want to run different javascript functions that are specific to either a whole table search or a column search, but when I try to use onSearch and onColumnSearch for that, the onSearch event gets triggered whenever an onColumnSearch is triggered. In other words, if the user enters a column search term, I don't want to run the function associated with an onSearch event, but that's what happens. I understand the thinking behind it, so I'm not saying that the behavior is wrong. I just would like to know how to distinguish the originating event - the event that triggered the search. And I can't base it on a search term change, because I want to capture the event where the user has clicked the trash can button when there is no search term in the input field associated with the table search (so that search term goes from empty string to empty string).
I was thinking that I could check all the values in the column filter inputs in an onSearch event, but I thought I would ask if there is a way to know what the originating event was (a column search or a "table search").
Example(s)
Open the console and then enter a column search term (e.g. search for '1' in the 'Item Name' column) and observe the 2 log prints. How can I run only the function associated with onColumnSearch and not subsequently run the onSearch associated function