【问题标题】:Resetting the column filters of HTML table on click单击时重置 HTML 表格的列过滤器
【发布时间】:2013-10-22 17:48:05
【问题描述】:

我正在使用列过滤器 jquery 来过滤 html 表格列。

这里是javascript:http://www.htmldrive.net/items/show/729/jQuery-Table-Column-Filters

您可以在此处查看演示:http://www.htmldrive.net/items/demo/729/jQuery-Table-Column-Filters

此 javascript 在表格标题中出现的文本框中输入内容时过滤表格列。

有什么方法可以让我们在实时点击某个按钮时重置所有过滤器(无需重新加载页面)

【问题讨论】:

    标签: jquery html filter tableview html-table


    【解决方案1】:

    也许这样:

    <button class="button">Clear</button>
    

    $(function() {
        $('.button').on(function() {
            $('._filterText').val('').trigger('change');
        });
    });
    

    .button 你的清除按钮类。

    【讨论】:

      【解决方案2】:

      该过滤器的所有输入框似乎都使用此类..._filterText...所以我想您可以尝试以下方法:

      <button id="ID_of_button" name="ID_of_button" type="button">Clear Stuff!</button>  
      
      <script>
      
      $(document).ready(function() {  
      
         $("#ID_of_button").on('click',function(){  
            $('._filterText').prop("value", "");  
         });
      
      });
      
      </script>
      

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2020-01-08
        • 2013-11-27
        • 2014-08-11
        • 2014-06-27
        • 1970-01-01
        • 2017-05-19
        相关资源
        最近更新 更多