Dealing with an ngTable that contains over 1000 records. Everything is functioning correctly, except for the filter. The issue I am encountering is that the filter only applies to text on the active page. For example, if I am on page 3 and search/filter using a textbox, it will only show results from page 3.
The code I am using is:
$scope.$watch("filter.$", function () {
$scope.tableParams.reload();});
$scope.tableParams = new ngTableParams({
page: 1,
count: 10,
sorting: {
schoolName: 'asc'
}
},
{
total: $scope.schoolInfo.length,
getData: function ($defer, params) {
var filteredData = {};
var orderedData = $filter('orderBy')($scope.schoolName, params.orderBy());
params.total(orderedData);
$defer.resolve(orderedData.slice((params.page() - 1) * params.count(), params.page() * params.count()));
},$scope:$scope
});
The sorting functionality works perfectly, but the search is the problem.
Search:
<input type="text" ng-model="search.schoolName">
I have also tried using ng-model="search" as well.
<tr ng-repeat="mydata in $data | filter:search">
I have also attempted using search:strict
I have tried various solutions without success. Can someone please assist me?
Thank you in advance