Is this the proper way to add a dropdown to the buttons extension?
Is this the proper way to add a dropdown to the buttons extension?
glimpsed_chaos
Posts: 140Questions: 30Answers: 4
I could not find an example specifically for adding a dropdown within the buttons.
This is what I have as an example - https://live.datatables.net/depikeri/1/
While it appears to be functional, I would much prefer an actual dropdown list where the button itself is present. This would prevent an additional click by users. Is there a way to add a dropdown with the buttons or inline next to the buttons?
This question has an accepted answers - jump to answer
Answers
Is it something like this that you are looking for?
Allan
Thank Allen, I think I put together what I am wanting - https://live.datatables.net/navagame/2/
I took another look and rather than focusing on the button extension I am utilizing - https://datatables.net/examples/advanced_init/dom_toolbar.html
With this, and some styling with Bootstrap, it appears I can place a dropdown list inline with the buttons.
Thanks for your time and any insight.
The next version of Buttons is going to use Bootstrap Dropdown styling for the Bootstrap styling integration with DataTables. That is already committed and in the nightly and looks like this: https://live.datatables.net/navagame/3/edit .
You could extend that to place actions on the buttons and make it basically a select list if you wanted.
Or, you absolutely can use a plain Bootstrap dropdown and insert it into the document around the table.
Allan
That's awesome! Thank you much for that update.