print

print

AloneInTheDarkAloneInTheDark Posts: 30Questions: 7Answers: 0

Hi,
i want when i press on print button the output is the result of ajax called.
How can i make it?

Replies

  • allanallan Posts: 63,794Questions: 1Answers: 10,513 Site admin

    There is no option for that in Buttons. You would need to create a custom button that functions the way you want.

    Allan

  • AloneInTheDarkAloneInTheDark Posts: 30Questions: 7Answers: 0

    Hi,
    this is my button. How can i get the selected row?

    Code

    $.fn.dataTable.ext.buttons.customprint = {
    className: 'buttons-alert',
    action: function ( e, dt, node, config )
    {
    [..] /// how can get the selected row?
    }
    };

  • allanallan Posts: 63,794Questions: 1Answers: 10,513 Site admin
    edited May 2016

    Use the selected option for selector-modifier. See the Select API documentation for details. edit correct link!

    Allan

  • AloneInTheDarkAloneInTheDark Posts: 30Questions: 7Answers: 0

    Hi, Allan
    tnk OK.....
    How can disable button on load page? And enable it when user select the row?
    Tnk

  • AloneInTheDarkAloneInTheDark Posts: 30Questions: 7Answers: 0

    Solution:

    init: function (e, settings, json ) {
        this.disable();
    },
    
  • allanallan Posts: 63,794Questions: 1Answers: 10,513 Site admin

    This is correct - good to hear you got it working. Another option is to extend the selected button type which will do that, and enablement when rows are selected, for you.

    Allan

  • AloneInTheDarkAloneInTheDark Posts: 30Questions: 7Answers: 0

    Hi,
    how can enable when user select a row?
    Like edit, delete button.....

  • allanallan Posts: 63,794Questions: 1Answers: 10,513 Site admin

    You could listen for selected, or just use the button I suggested above.

    Allan

This discussion has been closed.