Calling multiple extensions - Noob
Calling multiple extensions - Noob
http://bylicia.com/datatablehelp/ (my code is located at the top of main.js)
Any advice on the best way to call multiple extensions? I have four datatables. Each one under different jQuery UI tabs. I want all the tables to behave the same way.
I want to add ColReorder and ColVis.
Current (incorrect) code
$('table.display').dataTable( {
"scrollY": "500px", //scrolling
"scrollCollapse": true,
"paging": true,
"jQueryUI": true,
stateSave: true, //save state even after exiting
"dom": 'C<"clear">lfrtip', //column show/hide button and choices ColVis
"dom": 'Rlfrtip'//ColReorder
} );
My jQueryUI Themeroller also has some formatting errors once I added the Scroll function for jQueryUI - the spacing is off and the background of the table is now white instead of a dark blue. I can address this in another questions, but thought I would throw it out there.
Thank you in advance for any help.
This question has an accepted answers - jump to answer
Answers
You can only define one "dom" parameter. Currently your second one will just overwrite the first.
Thanks Tangerine. Right, it is overriding the first. What would be the best way to go about adding and calling multiple extensions. Is it possible? Thanks!
Sure - just add the
R
into the first one :-).As the documentation for
dom
says:In the case of ColReorder the letter to activate the feature is
R
and the ColVis letter isC
- so just make sure yourdom
string includes both.I do want to rewrite the
dom
option to be easier to use at some point, but I've yet to come up with a better way of doing it!Allan
Oh my! That makes so much sense now. It works and was very easy to fix. Thank you for clarifying and the dom documentation made sense. Thank you, thank you!