Closed modibo-26 closed 1 year ago
Hi all, I am attempting to include another group of button options on some of my tables with Symfony 6
I would like do like this code on https://datatables.net/extensions/buttons/examples/initialisation/multiple.html docs new $.fn.dataTable.Buttons( table, { buttons: [ { text: 'Button 2', action: function ( e, dt, node, conf ) { alert( 'Button 2 clicked on' ); } }, { text: 'Button 3', action: function ( e, dt, node, conf ) { alert( 'Button 3 clicked on' ); } } ] } );
table.buttons( 1, null ).container().appendTo( table.table().container() );
I tried : $('#dt').DataTable({ buttons: [ { text: 'Button 2', action: function (e, dt, node, conf) { alert('Button 2 clicked on'); } }, { text: 'Button 3', action: function (e, dt, node, conf) { alert('Button 3 clicked on'); } } ] }).buttons(1, null).container().appendTo( $('#dt') );
or : $.extend($.fn.dataTable.defaults, { dom: 'frtipB', buttons: [ { text: 'Button 2', action: function (e, dt, node, conf) { alert('Button 2 clicked on'); } }, { text: 'Button 3', action: function (e, dt, node, conf) { alert('Button 3 clicked on'); } } ] });
But no button appears. Any insights would be apprecied
Hi all, I am attempting to include another group of button options on some of my tables with Symfony 6
I would like do like this code on https://datatables.net/extensions/buttons/examples/initialisation/multiple.html docs new $.fn.dataTable.Buttons( table, { buttons: [ { text: 'Button 2', action: function ( e, dt, node, conf ) { alert( 'Button 2 clicked on' ); } }, { text: 'Button 3', action: function ( e, dt, node, conf ) { alert( 'Button 3 clicked on' ); } } ] } );
I tried : $('#dt').DataTable({ buttons: [ { text: 'Button 2', action: function (e, dt, node, conf) { alert('Button 2 clicked on'); } }, { text: 'Button 3', action: function (e, dt, node, conf) { alert('Button 3 clicked on'); } } ] }).buttons(1, null).container().appendTo( $('#dt') );
or : $.extend($.fn.dataTable.defaults, { dom: 'frtipB', buttons: [ { text: 'Button 2', action: function (e, dt, node, conf) { alert('Button 2 clicked on'); } }, { text: 'Button 3', action: function (e, dt, node, conf) { alert('Button 3 clicked on'); } } ] });
But no button appears. Any insights would be apprecied