-
Notifications
You must be signed in to change notification settings - Fork 50
Open
Description
I have a dynamic table with filters on each column.
I'm having trouble with a clear button that i'm trying to implement, to clear all filtered data.
The table row with the filters look like this
<tr class="data-grid-filters">
<td>
<input type="text" class="form-control input-sm order-search-box" ng-change="gridActions.filter()" ng-model="_id" filter-by="_id" filter-type="text">
</td>
<td>
<input type="text" class="form-control input-sm order-search-box" ng-change="gridActions.filter()" ng-model="reference" filter-by="reference" filter-type="text">
</td>
<td>
<input type="text" class="form-control input-sm order-search-box" ng-change="gridActions.filter()" ng-model="creationDate" filter-by="creationDate" filter-type="text">
</td>
<td>
<i class="fa fa-1x fa-trash" ng-click="clearFilters()" title="{{'DataGrid.ClearFilters' | translate}}"></i>
</td>
</tr>
First i have tried with Jquery with this function
$scope.clearFilters = function () {
var inputs = $(".data-grid-filters input");
$.each(inputs, function (index, value) {
$(inputs).eq(index)[0].value = "";
})
}
an then diggin up the public methods of the data-grid
$scope.clearFilters = function () {
$scope.gridOptions.grid.reloadGrid(false)
}
Need help!
Metadata
Metadata
Assignees
Labels
No labels