-
Notifications
You must be signed in to change notification settings - Fork 2.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Shouldn't the "filterChanged" event at least return the column for which the filter has changed? #4775
Comments
I cannot understand the issue. Is there a problem? Or are you suggesting an enhancement? |
This can be taken as an Enhancement request. The column argument will allow access to the changed column and also provide a way to access the grid without using "this" in strict mode. |
Ok, I see. Do you have a use case where this would advantage you? |
Yes. There is no other way to access the grid from the handler except for "this" which is given in the tutorial.
Or is there? Using "this" in "strict" mode is not allowed. Also, the specific column for which the filter has changed will be useful in updating the filter criteria.
|
Can someone provide workaround to find which column filter has changed on filterChanged? |
@yesarpit You will have to change the following lines in the "ui-grid.js" file.
This will return the current column for which the filter change event is being triggered. |
Thank you Rumeth for quick response, let me give it a try.Though you mentioned this solution a few months back, i thought its already patched with latest version. |
Hi, Is there a way you can make this change in the official tree? |
i second this for main code branch. And it cleans up error when multi-filters are used. Error is when last multi-filter is 'x' ed out and the grid does not return properly to a no-filter state (it filters on "" ) incorrectly. |
…terChanged function When using the filterChanged function, it's now possible to use the first argument - column - to simply do column.filters[0].term to retreive the search term for the column being filtered. This is especially useful if using external filtering. Closes angular-ui#4775
…terChanged function When using the filterChanged function, it's now possible to use the first argument - column - to simply do column.filters[0].term to retreive the search term for the column being filtered. This is especially useful if using external filtering. Closes #4775
UI Grid 3.0.6
The "filterChanged" event does not currently return anything as an argument.
The document specifies the following.
This should mean that due to the watch expression, the old & new filter terms cannot be returned.
There seems to be only 2 instances in which the "filterChanged" event is raised.
Both of them have access to the column for which they are being raised & can be changed to the following.
Is there any problem returning the column for for which the filter has changed?
The text was updated successfully, but these errors were encountered: