2013-04-11 53 views
1

我正在使用DataTables(成功),并试图合并ColumnFilter。我的JS如下所示:jQuery - DataTables - ColumnFilter不起作用

$(document).ready(function() { 
    oTable = $('#ecTable').dataTable({ 
     "sScrollY": "550px", 
     "sScrollX": "100%", 
     "bPaginate": false, 
     "bScrollCollapse": true, 
     "bInfo": true, 
     "bFilter": false, 
     "bProcessing": true, 
     "aaSorting": [[0, 'desc']] 
    }) 

    .columnFilter({ 
     aoColumns: [ 
      null, 
      null, 
      { type: "select" }, 
      { type: "select" }, 
      null, 
      null, 
      null, 
      null, 
      null, 
      null, 
      null, 
      null, 
      null, 
      null] 
    }); 
}); 

我的表的页眉和页脚看起来是这样的:

<thead> 
    <tr> 
     <th>Listing Date</th> 
     <th>Expiration Date</th> 
     <th>Manufacturer</th> 
     <th>Model</th> 
     <th>Body Style</th> 
     <th>Engine</th> 
     <th>Year</th> 
     <th>Mileage</th> 
     <th>Ext. Color</th> 
     <th>Int. Color</th> 
     <th>Listing Price</th> 
     <th>Comments</th> 
     <th>Number Of Views</th> 
     <th class="noSort">Navigation</th> 
    </tr> 
</thead> 

    <tfoot> 
     <tr> 
      <th>Listing Date</th> 
      <th>Expiration Date</th> 
      <th>Manufacturer</th> 
      <th>Model</th> 
      <th>Body Style</th> 
      <th>Engine</th> 
      <th>Year</th> 
      <th>Mileage</th> 
      <th>Ext. Color</th> 
      <th>Int. Color</th> 
      <th>Listing Price</th> 
      <th>Comments</th> 
      <th>Number Of Views</th> 
      <th></th> 
     </tr> 
    </tfoot> 

我没有得到在Chrome中的任何错误。生成的数据表格看起来应该与它应该完全一样,只是它没有过滤器列。查看生成的源代码,列过滤器的JS正在下载。谁能帮忙?

+0

我不是数据表专家,但是这行可能与它有关吗? '“bFilter”:false,' – 2013-04-11 17:58:15

+0

@Jules - 这正是问题所在!我关闭了这个功能,因为我不想使用默认的DataTables搜索功能。如果您将此创建为答案,我会将其投票并接受。 – 2013-04-11 18:01:32

+0

谢谢:)有时可能很难在你自己的代码中发现显而易见的东西。 – 2013-04-11 18:03:30

回答

3

评论晋升回答:

我不是数据表的专家,但可能这行有什么关系呢? "bFilter": false,

相关问题