Quantcast
Channel: Recent Discussions — DataTables forums
Viewing all articles
Browse latest Browse all 82352

columnFilter Plugin: How to exclude columns? (to avoid wrong column filter index)

$
0
0
I just implemented Drill Down rows (http://www.datatables.net/blog/Drill-down_rows) on a datatable with the columnFilter plugin. The Drill Down rows require a column to be inserted for the open/close buttons. How can I exclude this column from the list of searchable rows by the columnFilter plugin? I've already excluded the column from global filtering with "bSearchable".

My aoColumns:
"aoColumns"         : [
    {
        "mDataProp"         : null, 
        "mData"             : null,
        "bSortable"         : false,
        "bSearchable"       : false, // exclude from global filtering
        "sClass"            : "control center",
        "sDefaultContent"   : '<a href="#"><i class="icon-plus"></i></a>'
    },
    {
        "mDataProp"     : "browser",
    },
    {
        "mDataProp"     : "engine"
    },
],

Now, when i search the "browser" column, the column index is "sSearch_1" (it should be "sSearch_0" though, since the first column can't be searched). I tried adding a 'null' value for this column in the columnFilter() initialization but this doesn't solve the problem.
$('#example').dataTable().columnFilter(
    {
        "aoColumns"     : [
            null,
            {type: "text"},
            {type: "text"}
        ]
    }
);

Any help would be very much appreciated!

Viewing all articles
Browse latest Browse all 82352

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>