简体   繁体   English

如何在不刷新页面的情况下清空wenzhixin引导程序表中click事件的搜索框?

[英]how to empty search box on click event in wenzhixin bootstrap table without refresh page?

I want to empty search box. 我想清空搜索框。 when I click anywhere on a page then without refresh page I want to get an only empty search box in a wenzhixin bootstrap table 当我单击页面上的任意位置时没有刷新页面时,我想在wenzhixin引导表中获得一个唯一的空搜索框

 <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>

Here is an example: http://jsfiddle.net/9ynp8j6k/1/ 这是一个示例: http : //jsfiddle.net/9ynp8j6k/1/

You can empty the form field like this: 您可以像这样清空表单字段:

$('#clear').on("click",function() {
    $('.bootstrap-table .form-control').val("");
});

When you click on the clear button so search box value reset and you search again new fresh data. 当您单击清除按钮时,搜索框值将重置,然后再次搜索新的新数据。

$('#clear').on("click",function() {
     $('#bootstrap_table_ID').bootstrapTable("resetSearch","");
 });

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM