angular-ui/ui-grid

rowSearcher.stripTerm messes up the searchTerm

Open

#4,733 建立於 2015年11月19日

在 GitHub 查看
 (0 留言) (0 反應) (0 負責人)JavaScript (2,496 fork)batch import
help wanted

倉庫指標

Star
 (5,395 star)
PR 合併指標
 (30 天內沒有已合併 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.

貢獻者指南