sohilgupta123 / jquery-datatables-column-filter

Automatically exported from code.google.com/p/jquery-datatables-column-filter
0 stars 0 forks source link

Place filters outside table #19

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Filtering itselfs works like a charm. Except I need the select boxes outside my 
table in a div above the main table, not in the thead or tfoot.

Any idea how I can do this ?

tnx
Rob

Original issue reported on code.google.com by rob...@gmail.com on 11 Jul 2011 at 12:15

GoogleCodeExporter commented 9 years ago
you can extract the element tr from the table and insert it into a table you 
can place where you like.

try something like this:

<div id="divOutside">
    <table id="tableInYourDiv">
        <tbody id="filtersInYourDiv"> 
        </tbody>
    </table>
</div>

<table id="yourTable">
    <thead > 
    <tr id="header">
        <th>col 1</th>
        <th>col 2</th>
        <th>col 3</th>
    </tr>
    <tr id="filters">
        <th>col 1</th>
        <th>col 2</th>
        <th>col 3</th>
    </tr>
    </thead>
    <tbody...etc etc>

</table>

put this code after the table and filters have drawn (as last thing on your 
script, after $('#yourTable').dataTable().columnFilter(); )

$("#filtersInYourDiv").append($('#filters'));
//you can use $("head tr:last") if your filter tr doesn't have an id

Original comment by setm...@gmail.com on 11 Jul 2011 at 12:44

GoogleCodeExporter commented 9 years ago
Thanks for this comment.

I'm closing this issue.

Regards,
Jovan

Original comment by joc...@gmail.com on 25 Sep 2011 at 12:40