bgultekin / laravel4-datatables-package

Server-side handler of DataTables Jquery Plugin for Laravel 4
267 stars 108 forks source link

Column filtering #186

Closed jeremy379 closed 9 years ago

jeremy379 commented 9 years ago

Hi,

I try to use a column filtering (like this https://datatables.net/examples/api/multi_filter.html ), but the datables.net example don't work here.

No input added, et no search working.

How can i do ?

My html

table id="datatable-content-caracteristique"> /table>

And the js content (in view, 'cause i need columns generate by php)

$("#datatable-content-caracteristique").dataTable({ "processing": true, "serverSide": true, "ajax": { "url": "<?= Config::get('app.url')?>/ajax/produit/search, "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 }, @foreach($columns['data'] as $cn)

        { "data" : "{{ $cn }}",               "title" : "{{ $cn }}", "orderable": true, "searchable": true },
        @endforeach
    ],

});