ember 模型表中的 filterWithSelect,删除正则表达式
filterWithSelect in ember model Tables, remove regex
如果我在我的数据库中设置了一个字段以包括:男性和女性
我的专栏中有这个:
{
"propertyName": "sex",
"title": "Sex",
"filterWithSelect": true,
"sortFilterOptions": true
},
如果我 select 'female' 这很好用,但是 'male' 包括男女。有什么方法可以将它限制为整个字符串,而不是它做一个子字符串?
Ember-模型-table的defaultFilter
does not do regex, only substring search。
根据文档,您可以为采用 cell value to check, the filter string and optionally the whole record as arguments 的每一列提供自己的 filterFunction
,例如
{
"propertyName": "sex",
"filterWithSelect": true,
"filterFunction": (value, filterString) => value === filterString,
},
如果我在我的数据库中设置了一个字段以包括:男性和女性
我的专栏中有这个:
{
"propertyName": "sex",
"title": "Sex",
"filterWithSelect": true,
"sortFilterOptions": true
},
如果我 select 'female' 这很好用,但是 'male' 包括男女。有什么方法可以将它限制为整个字符串,而不是它做一个子字符串?
Ember-模型-table的defaultFilter
does not do regex, only substring search。
根据文档,您可以为采用 cell value to check, the filter string and optionally the whole record as arguments 的每一列提供自己的 filterFunction
,例如
{
"propertyName": "sex",
"filterWithSelect": true,
"filterFunction": (value, filterString) => value === filterString,
},