angular-ui/ui-grid

rowSearcher.stripTerm messes up the searchTerm

Open

#4,733 opened on 2015年11月19日

GitHub で見る
 (0 comments) (0 reactions) (0 assignees)JavaScript (2,496 forks)batch import
help wanted

Repository metrics

Stars
 (5,395 stars)
PR merge metrics
 (30d に merged PR はありません)

説明

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.

コントリビューターガイド