I want to change and reload the datatable via click on a button, but i get the folloging error:
datatables_swim_rec.php:3669 Uncaught TypeError: Cannot read property 'reload' of undefined
at y.action (datatables_swim_rec.php:3669)
at s (datatables.bundle.js:1)
at HTMLButtonElement.<anonymous> (datatables.bundle.js:1)
at HTMLButtonElement.dispatch (vendors.bundle.js:1)
at HTMLButtonElement.m.handle (vendors.bundle.js:1)
Is there any chances in the datatables scripts? Why can not read the ajax.url() and ajax.reload() ?
Here my datatable button definition:
dtButtons.push( {
text: '<span class="fa-layers fa-fw"><span class="fa-layers-text fs-20 txt-Red bold" id="01">01</span></span>',
titleAttr: 'SC01',
className: 'btn-primary btn-sm mr-1',
action: function() {
console.log('1');
s = 1;
myTable.ajax.url( myapp_config.assetsUrl + "/srv/obsv-server.php?rec=1&s=" + s );
myTable.ajax.reload( null, false );
}
} );
Andreas