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
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:
DataTable.Buttons.defaults.dom.button.tag = 'a';
before you initialise the DataTable.
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.
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.
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.
It looks like you're new here. If you want to get involved, click one of these buttons!
DataTables designed and created by SpryMedia Ltd.
SpryMedia Ltd is registered in Scotland, company no. SC456502.