When restoring a particular grid state with several filter parameters I noticed the filterChanged event triggered several times invoking the listener several times (in my case a bunch of ajax requests).
Base on the documentation (and code), the event doesn't return which filter changed so it seems useless to trigger all those events especially in the context of restoring state. Is this by design? If not, this seems like a bug to me. It would be better if it watched for changes similar to sortChanged.
I don't have a plunkr, but a simple way to reproduce would be to have multiple filters applied to a grid, save the state, restore the state. The grid.api.core.on.filterChanged should trigger several times when restoring the grid state.
Where the filterChanged event is invoked: https://github.com/angular-ui/ui-grid/blob/master/src/features/saveState/js/saveState.js#L592.
Where the sortChanged event is invoked: https://github.com/angular-ui/ui-grid/blob/master/src/features/saveState/js/saveState.js#L610
When restoring a particular grid state with several filter parameters I noticed the
filterChangedevent triggered several times invoking the listener several times (in my case a bunch of ajax requests).Base on the documentation (and code), the event doesn't return which filter changed so it seems useless to trigger all those events especially in the context of restoring state. Is this by design? If not, this seems like a bug to me. It would be better if it watched for changes similar to
sortChanged.I don't have a plunkr, but a simple way to reproduce would be to have multiple filters applied to a grid, save the state, restore the state. The
grid.api.core.on.filterChangedshould trigger several times when restoring the grid state.Where the
filterChangedevent is invoked: https://github.com/angular-ui/ui-grid/blob/master/src/features/saveState/js/saveState.js#L592.Where the
sortChangedevent is invoked: https://github.com/angular-ui/ui-grid/blob/master/src/features/saveState/js/saveState.js#L610