Can an extension inject options to DataTables prior to initialization?
Can an extension inject options to DataTables prior to initialization?
Can an extension add/inject an extra option (Ex: columns.className
) to datatables before initialization?
On preInit
, I tried to add columns.className
to settings.columnDefs, settings.aoColumnDefs & settings.aoColumns but all in vain.
I noticed that preInit
is being fired after datatables has already cached or generated all nodes, thus not so preInit as the name suggests.
Is there supposed to be another event which fires before preInit
so that extension authors can edit the options passed to datatables?
Thanks.
This question has an accepted answers - jump to answer
Answers
Currently no as it isn't something I've required before. The
preInit
event will trigger after the table's basic initialisation has occurred, but before the data is read in and displayed.Perhaps there should be an
initInit
(urgh) event or similar...Allan
How about preOptions? Where the event is passed the DataTable's Options before it is processed...
Yup - sounds sensible. {Link to your github discussion](https://github.com/DataTables/DataTables/issues/663) on this topic so we don't overlap.
Allan