Can I pass a second set of settings after the main one has been executed?

Can I pass a second set of settings after the main one has been executed?

maiolicamaiolica Posts: 1Questions: 0Answers: 0
edited February 2012 in DataTables 1.9
I'm trying to DRY my code by using a common initializer for all my tables, which pass to the datatable function all the common settings for my tables (aaSorting, sPaginationType, oLanguage)

After that code has been executed I would like to pass some more settings using separate functions, for example one of my table has this:

parent.$table.dataTable({

"aoColumns": [
null,
null,
null,
{ "sType": "uk_date" },
{ "bSortable": false },
{ "bSortable": false },
{ "bSortable": false }
]

});

The problem is using dataTable() again on an already initialized table, is there a solution?

Thanks

Replies

  • allanallan Posts: 63,498Questions: 1Answers: 10,471 Site admin
    You can set the bDestroy option. That will destroy the old table and recreate a new one. It isn't possible to change a lot of settings without reinitialising the table (as that would incur a huge code overhead that doesn't seem worth it for the majority of cases).

    Allan
This discussion has been closed.