omines / datatables-bundle

DataTables bundle for Symfony
https://omines.github.io/datatables-bundle/
MIT License
262 stars 113 forks source link

Individual column filtering #85

Closed Dr-Ash closed 5 years ago

Dr-Ash commented 5 years ago

Hello there!

I want to search by a single column in my datatable programatically via js. this is a snippet of my code :

`$('#dt').initDataTables({{ datatable_settings(datatable) }}, {

                    responsive: true,
                    searching: true,
                    stateSave: true,
                    "bFilter": true,
                }
            )
                .then(function (dt) {
                dt.on('init', function () {
                    $('#select-filter').on('change', function (e) {
                        if ($(this).val() == -1)
                            dt.search('').draw();
                        else {
                            dt.columns(0).search('lol').draw();
                        }
                    });
                });
            });`

if i search globally it works fine, but when i search on specific column nothing happens. i also added 'searchable' => true to my TableType columns.

burntblark commented 5 years ago

Hello @Dr-Ash, forgive my ignorance but why was this issue closed. I am currently facing this issue and would not want to create another issue thread?