angular-ui/ui-grid

rowSearcher.stripTerm messes up the searchTerm

Open

#4,733 opened on Nov 19, 2015

View on GitHub
 (0 comments) (0 reactions) (0 assignees)JavaScript (5,395 stars) (2,496 forks)batch import
help wanted

Description

So I set my col.filters[0].term with a custom filterTemplate to a string like 2015-01-01. Now I though this should work, however, it turns out that when the term gets passed into the condition function, it looks like this: 2015\-01\-01.

The problem seems to lie in rowSearcher#stripTerm, where escapeRegExp is called on the term when the term is a string.

Can anyone explain the logic behind this to me? The description of the function only states that stripTerm "Remove leading and trailing asterisk (*) from the filter's term". However, it obviously does way more. Also, the defined return value is the jsdoc is incorrect as the term is returned an not an int value representing the condition.

Contributor guide

rowSearcher.stripTerm messes up the searchTerm · angular-ui/ui-grid#4733 | Good First Issue