How can I set the class on the 'search' field on the datatables plugin please. I'm using the Jquery UI theme as well.
$('#idSmovData').dataTable( {
"sScrollY": "600px"
,"bPaginate": false
,"bFilter": true
,"bJQueryUI": true
,"bInfo": false
,"bSort": false
});
With the current version of DataTables you can do this using the 'search' function. var data_table = $('#data-table'). DataTable(); var column_index = 0; data_table. columns(column_index).search('^(?:(?!-).)
Filtering DataTable varieties of ways include select(String) method, which selects the required row or column and then based on that applies the filter. Filtering can be done using Select, Where, AND, OR, NOT logical operator and on top of it applying the value also there.
You can set the search filter wrapper div style class using oStdClasses
$.fn.dataTableExt.oStdClasses["sFilter"] = "my-style-class";
And than use regular css to target the search input field:
.my-style-class input[type=text] {
color: green;
}
Please refer to the datatables styling section for more details.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With