Add additional CSS to length dropdown select?
Add additional CSS to length dropdown select?
Sorry if this is a duplicate post - it's been a while since I posted a question and wasn't sure if mine all go into the Free Community support forum or if I can post to a specific forum.
Is there a way to add a custom CSS to the datatable length dropdown menu?
We have code that looks for changes on the page if someone tries to leave it, but we ignore fields with "ignore-changes" CSS. If someone changes the datatable length dropdown from 10 to 25 or whatever and tries to leave the page we're showing them a warning.
I'd like to add the ignore-changes css to that dropdown.
This question has an accepted answers - jump to answer
Answers
Use
$('div.dataTables_length select').addClass( ... );
once the table has been created (ininitComplete
if you are Ajax loading the data).Allan