I’m trying to set the defaults for the datatables I use in my project.
I can change dataTables defaults with:
$.extend($.fn.dataTable.defaults.oLanguage, {
"sProcessing": "Loading..."
});
But when I try to change a default for a plugin value, like:
$.extend($.fn.dataTable.defaults.oColVis, {
"buttonText": "Change columns"
});
It doesn’t works.
I tried to find the defaults used by the plugin in $.fn.dataTableExt but couldn’t find anything.
EDIT: just to be sure I made myself clear in my question, I know that I can change plugins properties in the dataTable initialization, as Nicola Peluchetti pointed out.
But I use the dataTable in different places in my project and I would have to repeat the code in various places that way. Not an option.
I’ve posted a reply in the DataTables forums: http://datatables.net/forums/discussion/11888/how-to-set-defaults-for-a-plugin . Basically you just need to alter the ColVis source at the moment.