Reputation: 417
im using the ui-grid and have a input Box. I want to bind the input box as a filter to the column in the grid. I dont want to use the buildin textbox in the ui-grid.
can anyone help ?
Upvotes: 0
Views: 1937
Reputation: 1664
As I was looking for the same kind of things, sunz7 answer helped me, but then, you can improve it, as in this state, the plunker provided by sunz7 do not allow to change the search. A new click on the button will trigger a search within the previous search.
And as bonus, an empty search field will remove the filter, just by changing
$scope.state.columns[1].filters.push({term: $scope.genderFilter});
by
$scope.state.columns[1].filters[0] = {term: $scope.genderFilter || '*'};
http://plnkr.co/edit/HN9kc9IbHdi9YH4OBUS7?p=preview
This fork of the plunker fix that.
Upvotes: 0
Reputation: 76
gridOption.columnDefs
, set the column you want to filter, for example: { field: 'gender', enableFiltering: false }
to disable inline filterUpvotes: 2