1

I'm using DataTables (successfully) and am trying to incorporate ColumnFilter. My JS looks as follows:

$(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]
    });
});

My table header and footer looks like this:

<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>

I'm not getting any errors in Chrome. The resulting data table looks exactly as it should, except it has no filter columns. Looking at the generated source, the JS for column filter is getting downloaded. Can anyone help?

5
  • I'm no datatables expert, but could this line have something to do with it? "bFilter": false, Commented Apr 11, 2013 at 17:58
  • @Jules - That was exactly the problem! I had this turned off because I didn't want to use the default DataTables searching. If you create this as an answer, I'll vote it up and accept it. Commented Apr 11, 2013 at 18:01
  • thanks :) it can be hard sometimes to spot the obvious in your own code. Commented Apr 11, 2013 at 18:03
  • @Jules - I guess it would help if the documentation were better. Commented Apr 11, 2013 at 18:06
  • @RandyMinder, if you need only slect filters you can also try out this filter plugin github.com/vedmack/yadcf :) Commented Apr 11, 2013 at 19:23

1 Answer 1

3

Comment promoted to answer:

I'm no datatables expert, but could this line have something to do with it? "bFilter": false,

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.