【发布时间】:2016-04-21 00:13:00
【问题描述】:
我有一个带有搜索栏的角度页面。我已经成功实现了一个搜索栏,并使用advanced search box 对其进行了改进。我的表有 2 列。 1 代表用户的姓名,2 代表用户在他/她的库存中拥有的物品数量。这就是用户对象在 json 中返回的方式:
{
"displayName":"John",
"items": [
{
"name":"foo1",
"type":"fooType1"
},
{
"name":"foo2",
"type":"fooType2"
},
{
"name":"foo3",
"type":"fooType3"
}
]
}
Angular 的$http 将其保存在数据对象中,我所要做的就是说data.items.length。所以在我的表格中我会显示:
+------+-------+
| Name | Items |
+------+-------+
| John | 3 |
+------+-------+
我想实现运算符搜索。所以我希望用户能够说find all users with at least 3 items 或find all users with more than 1 item but less than 5。但是我还没有找到任何支持这种运算符搜索的搜索栏功能。有没有办法用这个插件做到这一点?
此外,有没有办法使这些搜索的内容区分大小写或搜索整个单词而不是可能包含搜索查询的其他单词?
【问题讨论】:
标签: angularjs search html-table