Monday, May 13, 2024
 Popular · Latest · Hot · Upcoming
172
rated 0 times [  179] [ 7]  / answers: 1 / hits: 20563  / 9 Years ago, thu, september 10, 2015, 12:00:00

I use bootstrap-table and would like to use table-filter-control extension. In this example you can see how to use this extension. When I want to use this extension for more columns, it doesn't work. In my example filter works only for one column.



jsfiddle



html



<table ref=mainTable class=table table-striped table-bordered table-hover 
cellSpacing=0 id=mainTable data-show-toggle=true
data-show-columns=true data-search=true data-pagination=true data-filter-control=true>
<thead>
<tr>
<th data-field=state data-checkbox=true></th>
<th data-field=Customer Name data-sortable=true data-filter-control=select>Customer Name</th>
<th data-field=Location Type data-sortable=true>Location Type</th>
<th data-field=Location data-sortable=true data-filter-control=select>Location</th>
</tr>
</thead>
<tbody>
<tr>
<td></td>
<td>Cap Corp</td>
<td>Main</td>
<td>Norwalk CT 06851</td>
</tr>
<tr>
<td></td>
<td>Cap Corp</td>
<td>Other</td>
<td>Norwalk CT 06851</td>
</tr>
<tr>
<td></td>
<td>Tel</td>
<td>Main</td>
<td>Slough SL1 4DX</td>
</tr>
<tr>
<td></td>
<td>Tel</td>
<td>Other</td>
<td>London W1B 5HQ</td>
</tr>
</tbody>
</table>

More From » jquery

 Answers
8

data-filed should have not spaces, try to change



data-field=Customer Name


to



data-field=CustomerName


I updated your jsfiddle and filter-control works.



http://jsfiddle.net/5h595r6g/9/



However it would be great to implement filter options updating to available values, as I described in this post:



bootstrap table filter-control - how to unset unnecessary values from select options


[#65114] Tuesday, September 8, 2015, 9 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
jarettajb

Total Points: 678
Total Questions: 94
Total Answers: 90

Location: Guernsey
Member since Tue, Jul 6, 2021
3 Years ago
;