Server side and columns filter with text input
Server side and columns filter with text input
Hi,
I'm working with laravel, and i use a plugin https://github.com/bllim/laravel4-datatables-package who allow me to easily work with datatables.
But, i need to add text input in the table and allow user to search on each column.
Here, my js file (working perfectly, but without column filtering)
$("#datatable-content-caracteristique").dataTable({
"processing": true,
"serverSide": true,
"ajax": {
"url": "<?= Config::get('app.url')?>/ajax/produit/searchDbCaracteristique?,
"type": "post",
},
"order": [[1,'asc']],
"columnDefs": [ { //this prevents errors if the data is null
"targets": "_all",
"defaultContent": ""
} ],
"columns": [
//title will auto-generate th columns
{ "data" : "Create", "title" : " ", "orderable": false, "searchable": false },
<?php foreach($columns['data'] as $cn): ?>
{ "data" : "{{ $cn }}", "title" : "{{ $cn }}", "orderable": true, "searchable": true },
<?php endforeach; ?>
],
});
I try many solution, but nothing works
==> https://datatables.net/examples/api/multi_filter.html , don't work (dont' know why)
==> http://jquery-datatables-column-filter.googlecode.com/svn/trunk/serverSide.html , don't work (i can't use bProcessing and other b* params).
Any ideas ?
thx
This discussion has been closed.
Answers
you can try out my yadcf plugin for datatables, among dozens of cool features it does support server side filtering, see showacse sample http://yadcf-showcase.appspot.com/server_side_source.html and read docs
Hey
Finally i found
This https://datatables.net/examples/api/multi_filter.html works, but you need to use .DataTable in place of .dataTable (all works with d, but not the search ... )