【问题标题】:is there a way to change the jquery datatable filter behavior有没有办法改变 jquery 数据表过滤器的行为
【发布时间】:2010-01-19 03:56:13
【问题描述】:

使用现代浏览器,jquery 数据表插件运行良好,但在 ie6 中,我发现几乎不可能在过滤器文本框中输入,因为按键过滤非常慢,因此浏览器无法跟上您的输入。

与每次按键相比,是否有任何改变行为,使其仅搜索和过滤输入键?

【问题讨论】:

    标签: jquery internet-explorer-6 datatable plugins performance


    【解决方案1】:

    很遗憾,没有。但是,该库是开源的。那么,您可以尝试更改代码(您可能对第 3016 行附近的 .keyup 事件有一些运气)?

    【讨论】:

      【解决方案2】:

      你可以这样做

      $("#myTable 输入").keypress(函数(事件){

      //do here whatever you want here, ie (restrict minumu caracters in the field equals to 3)
      
      if($("#myTable input").val().lengh > 3)
         $("#myTable input").change(); //necesary for jquery datatables execute his own event functions 
      else
         //doNothing
      

      }

      您可以限制搜索最少的输入字母,而不会破坏服务器,只在搜索字段中搜索一个字母

      希望有帮助

      【讨论】:

        猜你喜欢
        • 2022-01-21
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2013-06-30
        • 1970-01-01
        • 2022-08-02
        • 1970-01-01
        • 2019-12-19
        相关资源
        最近更新 更多