Skip to content

Can`t clear selected filters #73

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
leonardoResendeLima opened this issue Mar 28, 2018 · 0 comments
Open

Can`t clear selected filters #73

leonardoResendeLima opened this issue Mar 28, 2018 · 0 comments

Comments

@leonardoResendeLima
Copy link

I have a dynamic table with filters on each column.

image

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!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant