Link for Export Instead of Button
Link for Export Instead of Button
ashebashistrash
Posts: 4Questions: 1Answers: 0
I'd like to create a kebab menu which contains the print, copy, excel, pdf options.
How do I convert the actions assigned to these buttons into links?
This question has an accepted answers - jump to answer
Answers
If we take this example, do you mean you want the
<button>
elements to be<a>
instead? I'm not clear on what the advantage of that is, but if that is what you want to do use:before you initialise the DataTable.
Allan
Sorry not sure I asked my question correctly. This is just for aesthetics as the buttons do not look pleasing on my page.
I want to utilize the copy, excel, pdf and print features but I want execute them in a kebab style menu.
I suppose what I really need is to understand how to link my menu to execute the functions tied to the buttons
This thread should help, particularly this example. It's showing how you can call the button's
action()
script within your kebab menu, without having the DataTables button on the page.Colin
Check out this example. It doesn't use the export buttons, but they could easily be put into the dropdown and you could readily style the main button with a kebab icon.
Allan
Hey Colin,
That's exactly what I'm looking for and should be extremely easy to implement but I can't see to get it to work. I created a test button just to make sure I could call the action before wasting time, sadly nothing happens when the button is click.
If I add B to my doms the pdf export button works, so I'm assuming the script I'm using has the correct extensions.
Here's the code I have after my table close tag.
nvm I solved it. Forgot I'm calling a variable (table) but I didn't have the variable assigned
Thanks for the update. Good to hear you have it working now.
Allan