0

我已经使用此代码为每个字段生成搜索框。但它在.columnFilter({ . 如何解决这个问题

<script type="text/javascript" charset="utf-8">
//initialisation code
    $(document).ready(function() {
        $('#example').dataTable( {
             "sPaginationType": "full_numbers",
             .columnFilter({
        sPlaceHolder: "head:before",
        aoColumns: [ {
                type: "select",
                values: [ 'Gecko', 'Trident', 'KHTML', 
                          'Misc', 'Presto', 'Webkit', 'Tasman']
                 },
                 { type: "text" },
                 { type: "number" },
                 { type: "date-range" },
                 { type: "number-range" }
            ]



        } );
    } );


</script>
4

2 回答 2

0

看起来像一个javascript语法问题。尝试更改为:

 $(document).ready(function() {
    $('#example').dataTable( {
         "sPaginationType": "full_numbers"
    })
         .columnFilter({
    sPlaceHolder: "head:before",
    aoColumns: [ {
            type: "select",
            values: [ 'Gecko', 'Trident', 'KHTML', 
                      'Misc', 'Presto', 'Webkit', 'Tasman']
             },
             { type: "text" },
             { type: "number" },
             { type: "date-range" },
             { type: "number-range" }
        ]



    } );
} );
于 2012-06-03T08:43:30.503 回答
0

$(document).ready(function(){ $('#example').dataTable().columnFilter(); })

确保您在 .columnFilter 之前关闭了 dataTable() 括号。

希望它有效。

于 2012-08-23T16:36:51.413 回答