Hi all,
I use Datatable with server side processing.
I want to filtering my datas with columnFilter but I don't know how do it.
Code JS :
Code HTML :
Thanks for your help
I use Datatable with server side processing.
I want to filtering my datas with columnFilter but I don't know how do it.
Code JS :
$('#tabDetail').dataTable({ "bProcessing": true, "bServerSide": true, "sAjaxSource": "server_processing.php", "fnServerData": function ( sSource, aoData, fnCallback, oSettings ) { oSettings.jqXHR = $.ajax( { "dataType": 'json', "type": "POST", "url": sSource, "data": aoData, "success": fnCallback }); } }).columnFilter({aoColumns:[ { type:"input", sSelector: "#usagerFilter" }, { type:"date-range", sSelector: "#dateFilter" }, { type:"select", sSelector: "#heureFilter" }, { type:"select", sSelector: "#decheterieFilter" } ]} );
Code HTML :
<table class="tabStatsFiltre" id="tabFilter"> <thead> <tr><th colspan="2">Filtres sur tableau</th></tr> </thead> <tbody> <tr id="filter_global"> <td align="center">Usager</td> <td align="center" id="usagerFilter"></td> </tr> <tr id="filter_col1"> <td align="center">Date d'entrée</td> <td align="center" id="dateFilter"></td> </tr> <tr id="filter_col2"> <td align="center">Heure d'entrée</td> <td align="center" id="heureFilter"></td> </tr> <tr id="filter_col3"> <td align="center">Déchèterie</td> <td align="center" id="decheterieFilter"></td> </tr> </tbody> </table> <br /> <table class="tabStats" id="tabDetail"> <thead> <tr> <th>Usager</th> <th>Date d'entrée</th> <th>Heure d'entrée</th> <th>Déchèterie</th> <th>Commune</th> <th>Statut</th> </tr> </thead> <tbody> </tbody> <tfoot> <tr> <th></th> <th></th> <th></th> <th></th> <th></th> <th></th> </tr> </tfoot> </table>
Thanks for your help