Sorting with jquery.dataTables.js and jquery.dataTables.columnFilter bug

Asked

Viewed 381 times

0

Imagem1Hello, friends I’m trying to put the filters in the first row of the table head, it almost worked if it were not for the fact of ordering, as shown in the image. Sorting cells have to be in the first header that does not have the text box. I am using jquery.dataTables.js plugins and jquery.dataTables.columnFilter.js filters

Anyone can help.

Code below

<table id="example" class="display">
    <thead>
        <tr>
            <th style="width:150px">Company name</th>

            <th style="width:350px">Date Created</th>
            <th style="width:250px">Date Updated</th>

        </tr>
        <tr>
            <th>Company name</th>

            <th>Date Created</th>
            <th>Date Updated</th>
        </tr>
    </thead>

    <tbody>
        <tr>
            <td>Emkay Entertainments</td>

            <td>28/05/2011</td>
            <td>25/08/2011 00:00:00</td>
        </tr>
        <tr>
            <td>The Empire</td>


            <td>16/06/2011</td>
            <td>10/07/2011 00:00:00</td>
        </tr>
        <tr>
            <td>Asadul Ltd</td>

            <td>13/07/2011</td>
            <td>12/09/2011 00:00:00</td>

        </tr>![inserir a descrição da imagem aqui][2]
 </table>



 $(document).ready(function() {
            $('#example').dataTable(
                )
                .columnFilter({
                    sPlaceHolder: "head:before",
                    aoColumns: [
                        { type: "text" },
                        { type: "text" },
                        { type: "text" },
                    ]
                });
        });

[2]:

  • came to see in the console to see if returns some kind of error ?

  • Speak master I understood that you wanted to put the call ... all right but it does not help much would not be better to put the return in case error in the browser console ?

  • take a look at the thead that has two lines duplicating ... maybe this can generate your problem

  • have to have even manow the duplicate lines

  • I got you guys.

1 answer

1

I decided to put this property "bSortCellsTop": true in the Datatable function.

$(document).ready(function () {
        $('#tbConvenios').dataTable({
            "bSortCellsTop": true
            })
      .columnFilter({
          sPlaceHolder: "head:before",
          aoColumns: [{ type: "text" },
                      { type: "text" },
                      { type: "text" },
                      { type: "text" }
          ]
      });
    });

Browser other questions tagged

You are not signed in. Login or sign up in order to post.