fix(3901): Raise rowsVisibleChanged on setVisibleRows. #5674
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Several issues and Stackoverflow threads indicate that one would expect the rowsVisibleChanged event to be emitted when a filter is applied. It seems pretty rational that rowsVisibleChanged ought to be raised by setVisibleRows(), which is what this small PR implements.
A related issue not addressed by this PR is that many of the SO threads and issues also seem to believe that a filtersChanged event should be raised after the visible rows are changed via filters. This is a common misunderstanding of how ui-grid operates in that changing filters are a different operation from changing visible rows. Since there seems to be a timing/ordering issue between when filtersChanged is raised and setVisibleRows is called this probably merits discussion before/if a change is made. Perhaps a tutorial page on events could alleviate this confusion?
#3901
#4138
http://stackoverflow.com/questions/27301690/angular-ui-grid-ng-grid-filterchanged-firing-too-frequently
http://stackoverflow.com/questions/33764946/how-to-get-filtered-data-from-paged-ui-grid