admin管理员组文章数量:1417070
I use bootstrap table for table management. I have a table with checkboxes, so I have used data-click-to-select = "true"
I also have a search bar I used data-search = "true"
When I select an item and I do a search I lose the item that was selected.
In the attached link an example: you select the first element "bootstrap-table" and after you put "b" in zone of search then the element will no longer be selected
1999
Fiddle
Any idea plz
I use bootstrap table for table management. I have a table with checkboxes, so I have used data-click-to-select = "true"
I also have a search bar I used data-search = "true"
When I select an item and I do a search I lose the item that was selected.
In the attached link an example: you select the first element "bootstrap-table" and after you put "b" in zone of search then the element will no longer be selected
1999
Fiddle
Any idea plz
Share Improve this question edited Jan 4, 2017 at 10:57 Ionut Necula 11.5k4 gold badges49 silver badges72 bronze badges asked Jan 4, 2017 at 10:37 el ogri amineel ogri amine 531 silver badge6 bronze badges2 Answers
Reset to default 5You can use data-maintain-selected="true"
to keep the selected checkbox.
Updated FIDDLE.
<table data-maintain-selected="true" data-toggle="table" data-url="/gh/get/response.json/wenzhixin/bootstrap-table/tree/master/docs/data/data1/" data-click-to-select="true" data-search="true">
<thead>
<tr>
<th data-field="state" data-checkbox="true"></th>
<th data-field="name">Name</th>
<th data-field="stargazers_count">Stars</th>
</tr>
</thead>
</table>
You can read more about data-maintain-selected
here.
data-maintain-meta-data="true"
...to maintain the following meta data on change page and search.
You can read more about data-maintain-selected here.
本文标签: javascriptThe selected item is lost after searchingBootstrap table afterStack Overflow
版权声明:本文标题:javascript - The selected item is lost after searching-Bootstrap table after - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1745260029a2650314.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论