angularjs - server side filtering with UI grid -
there default filtering provided ui grid whcih enabled using enablefiltering: false in gridoptions. instead of using default filtering use text entered in filter box multiple columns, send filters serevr , data back. have tried using filteroptions $scope.$watch('filteroptions', function (newval, oldval) {
if (newval !== oldval) { $scope.getpageddataasync($scope.gridoptions.$gridscope.filtertext); } }, true);
never gets invoked. appreciated.
there couple of different ways can this. in onregisterapi in grid options can this:
onregisterapi: function(gridapi) { gridapi.core.on.filterchanged($scope, function(rowentity, coldef, newvalue, oldvalue) { // check filter value changed , // value filter in column x can gridapi.grid.columns[x].filters[0] } ); }
you may set filter object on each cell. perhaps collect various columns wish filter on , put filter object on each of cells. whenever 1 changes have values need , can create function in "condition" called fltering.
filter: { type: xxx, condition: $scope.mycustomfilter } $scope.mycustomfilter = function(searchterm, callvalue) { // check various conditions here , return true/false }
Comments
Post a Comment