Strange button behavior?

Strange button behavior?

szakendreszakendre Posts: 24Questions: 10Answers: 0
edited September 2021 in DataTables

Hello,

I use the PHP version of Datatables with the following parameters:
Styling framework: jQuery UI,
Packages: jQuery 3, jQuery UI, DataTables, Editor

I define the buttons like this:

new $.fn.dataTable.Buttons( table1, {
    name: 'BTN-Edit1',
    buttons:[
        { extend: "edit",
        editor: editor1,
        text: "Value modification",
    action: function ( e, dt, node, config ) {
          ...
    } }, ]  } );

And assign the buttons to the datatable like this:

table1.buttons('BTN-Edit1', null).container().prependTo( $('div.fg-toolbar:eq(0)', table1.table().container() ) );

And I can use the show and hide fuctions:

table1.buttons('BTN-Edit1', null).container().show();
table1.buttons('BTN-Edit1', null).container().hide();

This is working well. But there is a problem:
When I use the DOM option dom: 'B' the following buttons appear: Copy, Excel, CSV, PDF and Print, and none of the self-defined buttons.

How can I use the DOM and button definitions at same time?

Thank you and best regards:
Endre, Szak

Answers

  • colincolin Posts: 15,112Questions: 1Answers: 2,583

    That definitely shouldn't be the case, see here - the 'B' in dom is present but you don't see the export buttons. They should only be present if declared in your initialisation.

    Are you able to link to your page please so we can take a look?

    Colin

Sign In or Register to comment.