¿Can i set buttons options by default?
¿Can i set buttons options by default?
mash180
Posts: 3Questions: 2Answers: 0
I would like to use the same buttons option on all my datatables, is posible to set this via $.fn.dataTable.defaults?
$.extend( $.fn.dataTable.defaults, {
deferRender: true,
processing: true,
serverSide: true,
iDisplayLength: 50,
orderMulti: false,
buttons: ['copy','print']
})
This discussion has been closed.
Answers
Use
$.extend( true, $.fn.dataTable.defaults, { ...
(note the addition oftrue
as the first parameter. That is required to make a deep copy.Allan
I get Cannot read property buttons of undefined
This is the test case http://live.datatables.net/rowakomi/1/edit
Hi,
This is a bug in Buttons 1.0.3 unfortunately. It has already been fixed in the nightly version of Buttons: http://live.datatables.net/rowakomi/2/edit .
The update to Buttons should be released later this week.
Allan