Working with 2 button instances for same table

Working with 2 button instances for same table

lincolncbennettlincolncbennett Posts: 25Questions: 11Answers: 1

Hi, this may be simple but I have 2 instances of buttons as I want to display one button within the table container as standard and one I want to append to a div outside table container. This is for the one table.

so for example, I have the below code to create the buttons

new $.fn.dataTable.Buttons( table, {      
    buttons: [ 
      { extend: 'create', 
        text: 'New active case', 
        editor: editor},                
              ]   
} );
new $.fn.dataTable.Buttons( table, {      
    buttons: [ 
      { extend: 'create', 
        text: 'New active case', 
        editor: editor},               
              ]      
} );

and I append the buttons to a div with

table.buttons().container()
  .appendTo("#controlPanel");

This shows both buttons in the div, but how can I just append one of the buttons? I have tried to define and target just one button instance but I must be going wrong some how.

Any help would be appreciated

Answers

This discussion has been closed.