I've set up a smart-table with pagination and search and I wish to display a sum of a column for all active rows. This means the entire data set by default and the filtered data set when a search is active. The smart-table documentation doesn't say much, so I've tried setting up a watch on my grid data variable. However, what this does is sum up only the rows on the current page, ignoring other pages. Can someone point me to where smart-table holds the current filtered data set and if there's a better way to watch for a search event? Thanks.
$scope.$watch('gridData', function() {
$scope.totalSum = 0;
angular.forEach($scope.gridData, function(row) {
$scope.totalSum += row.numericColumn;
});
});