How to get the orderable and searchable values for each column when using callbacks and api?
How to get the orderable and searchable values for each column when using callbacks and api?
kmd1970
Posts: 36Questions: 8Answers: 1
https://datatables.net/examples/api/multi_filter_select.html
i would like to expand on the example above by only adding select boxes for columns marked searchable
.
$(document).ready(function() {
$('#example').DataTable( {
initComplete: function () {
this.api().columns().every( function () {
var column = this;
//this does not work and/or does not exist
var searchable = column.searchable():
if (searchable){
....do something......
}
}
} );
} );
This discussion has been closed.
Replies
is correct. You won't find it in the documentation. It is a method I'm going to add in future, but at the moment you would need to use a class name or something that you can query external to DataTables.
Allan
Thanks again!