简体   繁体   English

Bootstrap-选择数据实时搜索,按数据标记和值搜索

[英]Bootstrap-Select Data Live Search, search by data tokens AND value

When you use the bootstrap select picker with live search, it will search by whatever option values are. 当您使用带有实时搜索的引导选择选择器时,它将按任何选项值进行搜索。

But when you add data-tokens, it then only searches by the data tokens. 但是当您添加数据令牌时,它只会按数据令牌进行搜索。 Is there a way I can make it search by both? 有没有办法可以让它同时搜索? Or should I be using data-subtext instead so that both things are searchable? 或者我应该使用数据子文本,以便两个东西都可以搜索?

I did this by including the value in the data tokens. 我通过在数据令牌中包含值来做到这一点。 Ended up with options that looked like this 结束了看起来像这样的选项

<option data-tokens='AVAS AV Accessories'>AV Accessories</option>

In this instance, the data-token only needed to be AVAS, the stock code for AV Accessories but I added the value since adding the token stopped the live search looking at the value. 在这种情况下,数据令牌只需要AVAS,AV附件的股票代码,但我添加了值,因为添加令牌停止了实时搜索查看值。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 无法提交数据实时搜索为true的表单(引导程序选择) - Can't submit form with data-live-search as true (Bootstrap-select) 在数据令牌包含所有数字(如“4730”)的情况下,在 bootstrap-select 组件中搜索不起作用 - Search in the bootstrap-select component is not working where data-token contains all numbers like "4730" 使用 jQuery 或 JavaScript 自动搜索 bootstrap-select - Automatic search for bootstrap-select with jQuery or JavaScript SelectPicker-如果引导程序选择结果不匹配,则选择“实时搜索”选项 - SelectPicker - Select option Live search if the result doesn't match by bootstrap-select 引导选择刷新并显示data-live-search =“ true” - bootstrap select refresh and show data-live-search=“true” 无法用数据实时搜索和多个jquery填充bootstrap选择 - Can not populate bootstrap select with data live search + multiple with jquery 如果引导选择中不存在搜索,则添加新选项 - Adding New Option If Search Are Not Exist In Bootstrap-Select 使用数据容器时引导选择错位列表 - Bootstrap-select misplacing list when using data-container 使用Glyphicon和Bootstrap“数据实时搜索”克隆表格行(下拉列表) - Cloning table row with Glyphicon and Bootstrap “Data Live Search” (Dropdown) 单击引导时打开警报,选择实时搜索 - Open alert on click of bootstrap select live search
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM