I'm building a Laravel app with AdminLTE integrated in the backend. AdminLTE uses DataTables to generate the tables, this works fine. But in AdminLTE it's only possible to sort columns, and it's not possible to filter columns. In one admin view I want to filter columns with a dropdown as shown in this DataTables example. I've tried to integrate the example code in AdminLTE file main.js. But I haven't got it working. In main.js there is a codesnippet where probably the new code should or could be integrated.
$('.datatable').each(function () {
if ($(this).hasClass('dt-select')) {
window.dtDefaultOptions.select = {
style: 'multi',
selector: 'td:first-child'
};
window.dtDefaultOptions.columnDefs.push({
orderable: false,
className: 'select-checkbox',
targets: 0
});
}
$(this).dataTable(window.dtDefaultOptions);
});
Does anyone have an idea how to get the filtering working?