Untitled conversation
- User
{ extend: 'collection', text: 'Export', className: 'btn btn-success', buttons: [ { extend: 'excel', title: 'Daily Bible Log - Bookmarks', action: function(e, dt, node, config) { if (dt.rows({ selected: true }).count() > 0) { dt.buttons.exportData({ selected: true }); } else { dt.buttons.exportData(); } } }, { extend: 'csv', title: 'Daily Bible Log - Bookmarks', action: function(e, dt, node, config) { if (dt.rows({ selected: true }).count() > 0) { dt.buttons.exportData({ selected: true }); } else { dt.buttons.exportData(); } } }, { extend: 'pdf', title: 'Daily Bible Log - Bookmarks', orientation: 'landscape', pageSize: 'LEGAL', action: function(e, dt, node, config) { if (dt.rows({ selected: true }).count() > 0) { dt.button(this).trigger('selected.export'); } else { dt.button(this).trigger('all.export'); } } }] }
this isnt triggering download in datatable
- Assistant
It seems like the code is missing the
customizeoption for each export type. Thecustomizeoption allows you to modify the exported data before it is downloaded.Here's an updated code that includes the
customizeoption:code