Skip to content

Commit

Permalink
Merge pull request #5593 from StrangelyTyped/filter-raw-term
Browse files Browse the repository at this point in the history
feat(filter): Add rawTerm option to columnDef filter options
  • Loading branch information
mportuga authored Sep 13, 2016
2 parents 4e395f6 + a75e65a commit 1c01e74
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
2 changes: 2 additions & 0 deletions src/js/core/factories/GridColumn.js
Original file line number Diff line number Diff line change
Expand Up @@ -740,6 +740,8 @@ angular.module('ui.grid')
* - ariaLabel: String that will be set to the `<input>.ariaLabel` attribute. This is what is read as a label to screen reader users.
* - noTerm: set this to true if you have defined a custom function in condition, and
* your custom function doesn't require a term (so it can run even when the term is null)
* - rawTerm: set this to true if you have defined a custom function in condition, and
* your custom function requires access to the raw unmodified search term that was entered
* - flags: only flag currently available is `caseSensitive`, set to false if you don't want
* case sensitive matching
* - type: defaults to {@link ui.grid.service:uiGridConstants#properties_filter uiGridConstants.filter.INPUT},
Expand Down
6 changes: 5 additions & 1 deletion src/js/core/services/rowSearcher.js
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,11 @@ module.service('rowSearcher', ['gridUtil', 'uiGridConstants', function (gridUtil

if ( !gridUtil.isNullOrUndefined(filter.term) ){
// it is possible to have noTerm.
newFilter.term = rowSearcher.stripTerm(filter);
if ( filter.rawTerm ){
newFilter.term = filter.term;
} else {
newFilter.term = rowSearcher.stripTerm(filter);
}
}
newFilter.noTerm = filter.noTerm;

Expand Down

0 comments on commit 1c01e74

Please sign in to comment.