searchPanes button to filter across all columns
searchPanes button to filter across all columns
Alessandrova
Posts: 24Questions: 7Answers: 0
I added a button to open the dialog in order to filter across all columns.
So far, my code is this:
<script>
$(document).ready(function() {
var dt = $('#myTable').DataTable( {
buttons:[
{
extend: 'searchPanes',
config: {
cascadePanes: true,
viewTotal: true,
orderable: false
}
}
],
searchPanes: {
viewTotal: true,
orderable: false
},
dom: 'Bfrtip',
select: {
style: 'os',
selector: 'td:first-child'
},
order: [[ 1, 'asc' ]]
});
dt.on('select.dt', () => {
dt.searchPanes.rebuildPane(0, true);
});
dt.on('deselect.dt', () => {
dt.searchPanes.rebuildPane(0, true);
});
});
</script>
I only get filters for two of the five columns I would like to consider.
Here is the URL:
http://trovawiki.altervista.org/museo_diocesano.php
Am I doing anything wrong?
This question has an accepted answers - jump to answer
This discussion has been closed.
Answers
Hi @Alessandrova ,
You can force panes for specific columns to show using the
columns.searchPanes.show
option. This example should help.Thanks,
Sandy
Thanks @sandy
your workaround works perfectly.
Brialliant.