1
有沒有辦法在具有「filter-select」屬性的列上刪除列值作爲過濾器。Tablesorter:不顯示特定列值作爲過濾器
下面是jsfiddle中的@mottie示例 http://jsfiddle.net/Mottie/856bzzeL/1085/。我只在列動物列中添加了「過濾器選擇」。有沒有一種方法,例如刪除考拉從下拉篩選器的值?
HTML
<table class="tablesorter">
<thead>
<tr>
<th>AlphaNumeric</th>
<th>Numeric</th>
<th class="filter-match filter-select">Animals</th>
<th>Sites</th>
</tr>
</thead>
<tbody>
<tr>
<td>abc 123</td>
<td>10</td>
<td>Koala</td>
<td>http://www.google.com</td>
</tr>
<tr>
<td>abc 1</td>
<td>234</td>
<td>Ox</td>
<td>http://www.yahoo.com</td>
</tr>
<tr>
<td>abc 9</td>
<td>10</td>
<td>Girafee</td>
<td>http://www.facebook.com</td>
</tr>
<tr>
<td>zyx 24</td>
<td>767</td>
<td>Bison</td>
<td>http://www.whitehouse.gov/</td>
</tr>
<tr>
<td>abc 11</td>
<td>3</td>
<td>Chimp</td>
<td>http://www.ucla.edu/</td>
</tr>
</tbody>
腳本:的tablesorter
/* Documentation for this tablesorter FORK can be found at
* http://mottie.github.io/tablesorter/docs/
*/
// See http://stackoverflow.com/q/40899404/145346
$(function(){
$('table').tablesorter({
theme: 'blue',
widgets: ['zebra', 'filter'],
widgetOptions: {
filter_defaultFilter: {
// Ox will always show
2: '{q}|Ox'
}
}
});
});