Extend Datatable button for particular datatable.
Extend Datatable button for particular datatable.
I have two or more datatable on Single page.
I want to extent functionality of buttons for one datatable and rest datatable buttons should work as same as.
I added class to check which table need extending buttons.
One datatable - Client side export and another for serverside export so it will not break code when client side export not working.
I had used as below:
on init.dt event
const api = new $.fn.dataTable.Api(settings);
api.buttons('.buttons-csv').action(function (e, dt, button, config) {
window.location = _buildUrl(dt, 'csv');
}).text(function (dt) {
return dt.i18n('buttons.csv', 'CSV');
});
Is there any good way or easy way to extend also class