启用行分组时,列过滤器中的标题消失

时间:2015-10-07 06:37:34

标签: jquery datatables

启用行分组时,“列过滤器”中的标题消失

我的代码是这样的:http://jsfiddle.net/oscar11/trp14hxk/

...
    function initTable(hasRowGrouping){   
         $('#example').dataTable({
             "bDestroy": true,
             "bLengthChange": false,
             "bPaginate": false,
             "bJQueryUI": true,
             "fnCreatedRow": function (nRow, aData, iDataIndex){
                 $(nRow).css('background-color', /*oData.colour*/ '#99F');
             }
         }).columnFilter({
                sPlaceHolder: "head:before",
                aoColumns: [
                    { type: "text" }, 
                    { type: "text" },
                    { type: "text" }, 
                    { type: "text" }, 
                    { type: "text" }
                ]
            });
...

谢谢

1 个答案:

答案 0 :(得分:0)

您可以通过在此JSFiddle链接中修改 columnFilter 来实现此目的:http://jsfiddle.net/trp14hxk/2/

...
  function initTable(hasRowGrouping){   
     $('#example').dataTable({
         "bDestroy": true,
         "bLengthChange": false,
         "bPaginate": false,
         "bJQueryUI": true,
         "fnCreatedRow": function (nRow, aData, iDataIndex){
             $(nRow).css('background-color', /*oData.colour*/ '#99F');
         }
     }).columnFilter({
            sPlaceHolder: "head:before",
            aoColumns: [
                null, 
                null, 
                null, 
                null, 
                null, 
            ]
        });
...