jQuery DataTables头部有两行:第一行列名和排序,第二行过滤

mg1*_*075 16 javascript jquery datatables

在旧版本的数据表(高达1.7.?),我以前可以有一个与一个两行列标题,其中分选顶行中完成一个表,包括在列名,和过滤用的输入和选择在第二行完成.

<table>
   <thead>
     <tr>
         <th>Col 1</th>
         <th>Col 2</th>
         <th>Col 3</th>
     </tr>
     <tr>
        <td><input type="text" /></td>
        <td><select><option ....></select></td>
        <td><input type="text" /></td>         
     </tr>
  </thead>
  <tbody>...
Run Code Online (Sandbox Code Playgroud)

对于更高版本,包括最新版本(1.9.0),这不再有效,因为可排序标头将应用于第二行而不是第一行.有没有办法让这个工作,而不诉诸http://code.google.com/p/jquery-datatables-column-filter/等额外的插件 ?

mg1*_*075 17

jQuery DataTables作者Allan Jardine指出了一种简单的方法来完成这项工作:使用bSortCellsTop自1.8版本开始提供的选项.

http://datatables.net/ref#bSortCellsTop

(http://datatables.net/ref)

http://datatables.net/forums/discussion/9046/two-rows-in-thead-first-row-for-sorting-second-row-for-column-filtering

jQuery DataTables的+1!