2016-10-25 3 views
0

私は最近、jquery DataTablesの使用を開始しました。列フィルタリングについては、最近の更新はないようですが(多数の開発者のパッチを除いて)オリジナルの "columnfilter"プラグインを調べています。また、バージョン1.10にも適合していません。バージョン1.10で列特有のフィルタリングを行うための好ましい方法は何ですか? (クライアント側とサーバー側の両方)データ型の好ましい方法1.10列固有のフィルタリング?

答えて

0

は、私が唯一のこれまでのクライアント側を使用していると、このコード:

 $("#browse_1_div thead input").keyup(function() { 
      /* Filter on the column (the index) of this element */ 
      oTable.fnFilter(this.value, $("thead input").index(this)); 
     }); 

     /* 
     * Support functions to provide a little bit of 'user friendlyness' to the textboxes in 
     * the footer 
     */ 
     $("#browse_1_div thead input").each(function (i) { 
      asInitVals[i] = this.value; 
     }); 

     $("#browse_1_div thead input").focus(function() { 
      if (this.className == "search_init_1") 
      { 
       this.className = ""; 
       this.value = ""; 
      } 
     }); 

     $("#browse_1_div thead input").blur(function (i) { 
      if (this.value == "") 
      { 
       this.className = "search_init_1"; 
       this.value = asInitVals[$("#browse_1_div thead input").index(this)]; 
      } 
     }); 
+0

私はcolumnFilterプラグインにこれ​​を比較すると、これは仕事の非常に多くのように思える... – Danny

+0

それはかなり古くからのコードの平和ですが、それは今のように機能します。 –

関連する問題