如何清空文智信bootstrap table点击事件时不刷新页面的搜索框?
how to empty search box on click event in wenzhixin bootstrap table without refresh page?
我想清空搜索框。当我点击页面上的任何地方然后没有刷新页面我想在文智信中获得一个空的搜索框bootstrap table
<table id="view_table" data-toggle="table"
data-search="true"
data-page-list="[5, 10, 20]"
data-page-size="5"
data-pagination="true"
data-show-pagination-switch="true" >
<thead>
<tr class="table-heading">
<th data-field="image"><h4>Image</h4></th>
<th data-field="name"><h4>Name</h4></th>
</tr>
</thead>
<tbody>
</tbody>
</table>
<button id="empty_search" class="btn btn-primary">Save</button>
<script>
$('#empty_search').on('click', function(){
$.(this.["data-search"]).empty();
});
</script>
这里有一个例子:http://jsfiddle.net/9ynp8j6k/1/
您可以像这样清空表单域:
$('#clear').on("click",function() {
$('.bootstrap-table .form-control').val("");
});
当您点击清除按钮时,搜索框值会重置,您会再次搜索新数据。
$('#clear').on("click",function() {
$('#bootstrap_table_ID').bootstrapTable("resetSearch","");
});
我想清空搜索框。当我点击页面上的任何地方然后没有刷新页面我想在文智信中获得一个空的搜索框bootstrap table
<table id="view_table" data-toggle="table"
data-search="true"
data-page-list="[5, 10, 20]"
data-page-size="5"
data-pagination="true"
data-show-pagination-switch="true" >
<thead>
<tr class="table-heading">
<th data-field="image"><h4>Image</h4></th>
<th data-field="name"><h4>Name</h4></th>
</tr>
</thead>
<tbody>
</tbody>
</table>
<button id="empty_search" class="btn btn-primary">Save</button>
<script>
$('#empty_search').on('click', function(){
$.(this.["data-search"]).empty();
});
</script>
这里有一个例子:http://jsfiddle.net/9ynp8j6k/1/
您可以像这样清空表单域:
$('#clear').on("click",function() {
$('.bootstrap-table .form-control').val("");
});
当您点击清除按钮时,搜索框值会重置,您会再次搜索新数据。
$('#clear').on("click",function() {
$('#bootstrap_table_ID').bootstrapTable("resetSearch","");
});