esvit / ng-table

Simple table with sorting and filtering on AngularJS
http://esvit.github.io/ng-table
BSD 3-Clause "New" or "Revised" License
2.77k stars 851 forks source link

feat($browser): Added events to provide the data after it is filtered… #937

Closed dburner closed 7 years ago

dburner commented 7 years ago

… and after it is sorted.

Added new events to the ngTableEventsChannel that fire when the ngTableDefaultGetData filters and

sorts the data. This is usefull when you want to try to export only the filtered data or when you

want to make some real time statistics over the data that is beeing filtered.

christianacca commented 7 years ago

The travis build is failing on some e2e tests. Nothing to do with this PR though!

Once I fix these (next few days hopefully), this PR will automatically get published to npm...

dburner commented 7 years ago

Great, thanks :+1: By the way I think this resolves some issues like: issue #771, I should have mentioned them maybe in the commit.

christianacca commented 7 years ago

Hi @dburner,

Just a heads up that the signature of the two new events are going to change in the next (?) release of ng-table.

See this commit for details: https://github.com/esvit/ng-table/commit/a9a72b4ea2f2ce99c32ae9a08cabb4eb539c7121

I don't think that should be a problem for you, but if it is let me know.

C

dburner commented 7 years ago

@christianacca thanks for the heads up, no it won't be a problem :)

Matias-Barrios commented 6 years ago

Hi guys,

one question, is this actually fixed? When I call $scope.tableParams.data im still getting only the visible page and not the whole set of filtered data. @christianacca @dburner

dburner commented 6 years ago

@elMatidelUru , yes, but $scope.tableParams.data was not intented to get the whole data, to access the whole data after it is filtered you need to place the following code:

ngTableEventsChannel.onAfterDataFiltered((p, results) => {
    // results is all the filtered data
}
, this.tableParams); 
Matias-Barrios commented 6 years ago

Thanks! @dburner

Matias-Barrios commented 6 years ago

Thanks! @dburner

Matias-Barrios commented 6 years ago

Thanks! @dburner

qmy777 commented 6 years ago

Sorry about this.

In angularjs, whether there has the onAfterDataFiltered events to listen?

Thanks!