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.

贡献者指南