限制Jquery表筛选器
早上好 我试图找出在搜索表时如何避免搜索和排序第一行。当前,在输入文本时,它会过滤字段 感谢您的帮助限制Jquery表筛选器,jquery,Jquery,早上好 我试图找出在搜索表时如何避免搜索和排序第一行。当前,在输入文本时,它会过滤字段 感谢您的帮助 已解决-刚刚添加了第二行标题/facepalm您需要在标签中添加过滤器输入 使用以下命令更改HTML代码 <div class="row"> <div class="col-lg-12"> <div class="white-box">
已解决-刚刚添加了第二行标题/facepalm您需要在标签中添加过滤器输入 使用以下命令更改HTML代码
<div class="row">
<div class="col-lg-12">
<div class="white-box">
<h3 class="box-title m-b-0">Column Toggle Table</h3>
<p class="text-muted m-b-20">The Column Toggle Table allows the user to select which columns they want to be visible.</p>
<table class="tablesaw table-striped table-hover table-bordered table" data-tablesaw-mode="columntoggle" id="filtersearch">
<thead>
<tr>
<th scope="col" data-tablesaw-sortable-col data-tablesaw-priority="persist">Movie Title <br/></th>
<th scope="col" data-tablesaw-sortable-col data-tablesaw-sortable-default-col data-tablesaw-priority="3">Rank <br/></th>
<th scope="col" data-tablesaw-sortable-col data-tablesaw-priority="2">Year <br/></th>
<th scope="col" data-tablesaw-sortable-col data-tablesaw-priority="1">
<abbr title="Rotten Tomato Rating">Rating </abbr>
</th>
<th scope="col" data-tablesaw-sortable-col data-tablesaw-priority="4">Gross </th>
</tr>
<tr>
<td><input type='text' value='' class='filter' data-column-index='0'></td>
<td><input type='text' value='' class='filter' data-column-index='1'></td>
<td><input type='text' value='' class='filter' data-column-index='2'></td>
<td><input type='text' value='' class='filter' data-column-index='3'></td>
<td><input type='text' value='' class='filter' data-column-index='4'></td>
</tr>
</thead>
<tbody>
<tr>
<td class="title"><a href="javascript:void(0)">Avatar</a></td>
<td>1</td>
<td>2009</td>
<td>83%</td>
<td>$2.7B</td>
</tr>
<tr>
<td class="title"><a href="javascript:void(0)">Titanic</a></td>
<td>2</td>
<td>1997</td>
<td>88%</td>
<td>$2.1B</td>
</tr>
<tr>
<td class="title"><a href="javascript:void(0)">The Avengers</a></td>
<td>3</td>
<td>2012</td>
<td>92%</td>
<td>$1.5B</td>
</tr>
<tr>
<td class="title"><a href="javascript:void(0)">Harry Potter and the Deathly Hallows—Part 2</a></td>
<td>4</td>
<td>2011</td>
<td>96%</td>
<td>$1.3B</td>
</tr>
<tr>
<td class="title"><a href="javascript:void(0)">Frozen</a></td>
<td>5</td>
<td>2013</td>
<td>89%</td>
<td>$1.2B</td>
</tr>
<tr>
<td class="title"><a href="javascript:void(0)">Iron Man 3</a></td>
<td>6</td>
<td>2013</td>
<td>78%</td>
<td>$1.2B</td>
</tr>
<tr>
<td class="title"><a href="javascript:void(0)">Transformers: Dark of the Moon</a></td>
<td>7</td>
<td>2011</td>
<td>36%</td>
<td>$1.1B</td>
</tr>
<tr>
<td class="title"><a href="javascript:void(0)">The Lord of the Rings: The Return of the King</a></td>
<td>8</td>
<td>2003</td>
<td>95%</td>
<td>$1.1B</td>
</tr>
<tr>
<td class="title"><a href="javascript:void(0)">Skyfall</a></td>
<td>9</td>
<td>2012</td>
<td>92%</td>
<td>$1.1B</td>
</tr>
<tr>
<td class="title"><a href="javascript:void(0)">Transformers: Age of Extinction</a></td>
<td>10</td>
<td>2014</td>
<td>18%</td>
<td>$1.0B</td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
<!-- /.row -->
</div>
列切换表
列切换表允许用户选择要显示的列
电影名称
排名
年份
1.
2009
83%
27亿美元
2.
1997
88%
21亿美元
3.
2012
92%
15亿美元
4.
2011
96%
13亿美元
5.
2013
89%
120亿美元
6.
2013
78%
120亿美元
7.
2011
36%
11亿美元
8.
2003
95%
11亿美元
9
2012
92%
11亿美元
10
2014
18%
10亿美元
所以。。。您想在以下情况下禁用搜索。。。搜索?我想禁用搜索第一行,在JSFIDLE中,第一行是一个输入字段
<div class="row">
<div class="col-lg-12">
<div class="white-box">
<h3 class="box-title m-b-0">Column Toggle Table</h3>
<p class="text-muted m-b-20">The Column Toggle Table allows the user to select which columns they want to be visible.</p>
<table class="tablesaw table-striped table-hover table-bordered table" data-tablesaw-mode="columntoggle" id="filtersearch">
<thead>
<tr>
<th scope="col" data-tablesaw-sortable-col data-tablesaw-priority="persist">Movie Title <br/></th>
<th scope="col" data-tablesaw-sortable-col data-tablesaw-sortable-default-col data-tablesaw-priority="3">Rank <br/></th>
<th scope="col" data-tablesaw-sortable-col data-tablesaw-priority="2">Year <br/></th>
<th scope="col" data-tablesaw-sortable-col data-tablesaw-priority="1">
<abbr title="Rotten Tomato Rating">Rating </abbr>
</th>
<th scope="col" data-tablesaw-sortable-col data-tablesaw-priority="4">Gross </th>
</tr>
<tr>
<td><input type='text' value='' class='filter' data-column-index='0'></td>
<td><input type='text' value='' class='filter' data-column-index='1'></td>
<td><input type='text' value='' class='filter' data-column-index='2'></td>
<td><input type='text' value='' class='filter' data-column-index='3'></td>
<td><input type='text' value='' class='filter' data-column-index='4'></td>
</tr>
</thead>
<tbody>
<tr>
<td class="title"><a href="javascript:void(0)">Avatar</a></td>
<td>1</td>
<td>2009</td>
<td>83%</td>
<td>$2.7B</td>
</tr>
<tr>
<td class="title"><a href="javascript:void(0)">Titanic</a></td>
<td>2</td>
<td>1997</td>
<td>88%</td>
<td>$2.1B</td>
</tr>
<tr>
<td class="title"><a href="javascript:void(0)">The Avengers</a></td>
<td>3</td>
<td>2012</td>
<td>92%</td>
<td>$1.5B</td>
</tr>
<tr>
<td class="title"><a href="javascript:void(0)">Harry Potter and the Deathly Hallows—Part 2</a></td>
<td>4</td>
<td>2011</td>
<td>96%</td>
<td>$1.3B</td>
</tr>
<tr>
<td class="title"><a href="javascript:void(0)">Frozen</a></td>
<td>5</td>
<td>2013</td>
<td>89%</td>
<td>$1.2B</td>
</tr>
<tr>
<td class="title"><a href="javascript:void(0)">Iron Man 3</a></td>
<td>6</td>
<td>2013</td>
<td>78%</td>
<td>$1.2B</td>
</tr>
<tr>
<td class="title"><a href="javascript:void(0)">Transformers: Dark of the Moon</a></td>
<td>7</td>
<td>2011</td>
<td>36%</td>
<td>$1.1B</td>
</tr>
<tr>
<td class="title"><a href="javascript:void(0)">The Lord of the Rings: The Return of the King</a></td>
<td>8</td>
<td>2003</td>
<td>95%</td>
<td>$1.1B</td>
</tr>
<tr>
<td class="title"><a href="javascript:void(0)">Skyfall</a></td>
<td>9</td>
<td>2012</td>
<td>92%</td>
<td>$1.1B</td>
</tr>
<tr>
<td class="title"><a href="javascript:void(0)">Transformers: Age of Extinction</a></td>
<td>10</td>
<td>2014</td>
<td>18%</td>
<td>$1.0B</td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
<!-- /.row -->
</div>