Skip to content

Commit

Permalink
feat(filterChanged): pass the changed column as first argument to fil…
Browse files Browse the repository at this point in the history
…terChanged function

When using the filterChanged function, it's now possible to use the first argument - column - to simply do column.filters[0].term to retreive the search term for the column being filtered. This is especially useful if using external filtering.

Closes #4775
  • Loading branch information
caseyjhol authored and mportuga committed Apr 30, 2019
1 parent 77792f5 commit 13eacc3
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion packages/core/src/js/directives/ui-grid-header-cell.js
Original file line number Diff line number Diff line change
Expand Up @@ -237,7 +237,7 @@
$scope.col.filters.forEach( function(filter, i) {
filterDeregisters.push($scope.$watch('col.filters[' + i + '].term', function(n, o) {
if (n !== o) {
uiGridCtrl.grid.api.core.raise.filterChanged();
uiGridCtrl.grid.api.core.raise.filterChanged( $scope.col );
uiGridCtrl.grid.api.core.notifyDataChange( uiGridConstants.dataChange.COLUMN );
uiGridCtrl.grid.queueGridRefresh();
}
Expand Down
2 changes: 1 addition & 1 deletion packages/saveState/src/js/saveState.js
Original file line number Diff line number Diff line change
Expand Up @@ -587,7 +587,7 @@
delete currentCol.filters[index].term;
}
});
grid.api.core.raise.filterChanged();
grid.api.core.raise.filterChanged( currentCol );
}

if ( !!grid.api.pinning && grid.options.savePinning && currentCol.renderContainer !== columnState.pinned ) {
Expand Down

0 comments on commit 13eacc3

Please sign in to comment.