Override specific default options
Override specific default options
Jumpy
Posts: 3Questions: 1Answers: 1
Hi,
I defined the default options, for example, like this:
$.extend(true, $.fn.dataTable.defaults, {
columnDefs: [
{ orderable: false, searchable: false, className: "text-center", targets: 'ButtonColumns' }
]
});
Now, for a specific table, I need to specify the responsivePriority:
var table = $('table').DataTable({
columnDefs: [
{ responsivePriority: 1, targets: 0 },
{ responsivePriority: 2, targets: -1 }
]
});
My problem is that the columnDefs property defined for the specific table overrides the default one.
Is there a way to override only the responsivePriority option?
This question has an accepted answers - jump to answer
This discussion has been closed.
Answers
I returned to this question after a while and this is the solution I adopted:
If there are more tables in the same page it can be used this solution:
Hi,
Sorry I never managed to reply to you originally. That looks like an ideal solution - thanks for posting back and sharing it with everyone!
Allan
Don't worry
I edited the post to add another solution for more tables in the same page.