How to customise any button to work as(pdf/excel)

How to customise any button to work as(pdf/excel)

bbnnmm500bbnnmm500 Posts: 2Questions: 1Answers: 0

I made a data table and everything is good but I want to make the CVS/pdf button in another button(default is in the header), is there any way to customize any button work as those buttons

This question has an accepted answers - jump to answer

Answers

  • colincolin Posts: 15,240Questions: 1Answers: 2,599
    Answer ✓

    This thread should help, it's asking the same thing (and here too).

    Cheers,

    Colin

  • bbnnmm500bbnnmm500 Posts: 2Questions: 1Answers: 0
    edited July 2021

    it is not useful can you help me

  • kthorngrenkthorngren Posts: 21,322Questions: 26Answers: 4,948
    edited July 2021

    The second thread Colin linked to has the simple answer:

    All I had to do is change the dom option of the Datatable from this Bfrtip to frtip to hide it

    Then use button().trigger() in your button click event to trigger the appropriate Datatables button.

    If you still need help then please provide a running test case showing the layout you have in your screenshot. We can then provide specific code, for your solution, to show you what to do.
    https://datatables.net/manual/tech-notes/10#How-to-provide-a-test-case

    Kevin

  • colincolin Posts: 15,240Questions: 1Answers: 2,599

    Here's a working example of that - calling button().trigger() to call the button's action script.

    Colin

Sign In or Register to comment.