buttons ext: how to call default action callback

buttons ext: how to call default action callback

mutexmutex Posts: 2Questions: 1Answers: 0

Inside an overridden action callback I use to set config, how do I call the original callback?

Thanks.

Answers

  • mutexmutex Posts: 2Questions: 1Answers: 0

    My hack I found after a while was to:
    - initialise the datatable as per usual,
    - save the default handler,
    - register my handler and call the default handler within my handler when done

    snip:
    var data_table = table.DataTable(options);

        var default_action = data_table.button(2).action();
    
        data_table.button(2).action(function (e, dt, button, config) {
            do stuff... like set config.message
    
            default_action(e, dt, button, config);
        });
    
  • allanallan Posts: 63,725Questions: 1Answers: 10,505 Site admin

    Currently that is the best way of doing it. I'd like to introduce something like super() method, but that will probably come in a future version.

    Allan

This discussion has been closed.