Skip to content

Commit

Permalink
fix(filters): startsWith/endsWith operator should work
Browse files Browse the repository at this point in the history
- fix an issue was reported in Angular-Slickgrid
  • Loading branch information
ghiscoding committed Jul 16, 2021
1 parent 32032b8 commit f99f1c5
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -65,9 +65,9 @@ export function getFilterParsedText(inputSearchTerms: SearchTerm[] | undefined):

/** Execute the filter string test condition, returns a boolean */
function testStringCondition(operator: OperatorType | OperatorString, cellValue: string, searchValue: string, searchInputLastChar?: string): boolean {
if (operator === '*' || operator === OperatorType.endsWith) {
if (operator === '*' || operator === OperatorType.endsWith || operator === '*z') {
return cellValue.endsWith(searchValue);
} else if ((operator === '' && searchInputLastChar === '*') || operator === OperatorType.startsWith) {
} else if ((operator === '' && searchInputLastChar === '*') || operator === OperatorType.startsWith || operator === 'a*') {
return cellValue.startsWith(searchValue);
} else if (operator === '' || operator === OperatorType.contains) {
return (cellValue.indexOf(searchValue) > -1);
Expand Down

0 comments on commit f99f1c5

Please sign in to comment.