DT 10.1 - Extra button

DT 10.1 - Extra button

deliatordeliator Posts: 95Questions: 1Answers: 0

Hello,

I have buttons initially disabled who become active when i select a row.
How can i add an extra button (always active) linked to another ajax call i.e ?

At this time i have something like this :

buttons: true,
buttons: [
{
extend: 'selectedSingle',
className: "btn btn-primary sButtonClass",
text: '<i class="fa fa-pencil-square-o"></i> Détail',
action: function ( e, dt, button, config ) {
console.log( dt.row( { selected: true } ).data() );
}
},

Thanks

Replies

  • allanallan Posts: 63,761Questions: 1Answers: 10,510 Site admin

    You can use the button().add() method to create a new button.

    Allan

  • deliatordeliator Posts: 95Questions: 1Answers: 0

    Ok Allan, i found another way (dunno if it is the nicest) i just comment the extend line

    {
    //extend: 'selectedSingle',
        className: "btn btn-primary sButtonClass",
        text: '<i class="fa fa-chain-broken"></i> Rejets',
        action: function (  ) {
        BootstrapDialog.show({
        title: 'Rejets',
        size: BootstrapDialog.SIZE_WIDE,
        message: $('<div>Test</div>').load('rejets.cfm')
        });
        }   
    },
    

    Your advice ?

This discussion has been closed.