How can I add a custom button/link to datatables
How can I add a custom button/link to datatables
monkeytooth
Posts: 22Questions: 0Answers: 0
I want to add to the layout so to speak on some of my tables, and I havent found a good way to do it. I tried to understand "sDom" but failed at that.
What I have is moved the "info" to the right and I want something where it was to act as a link/button on the left. So basically lower left right below the table itself. Any ideas?
What I have is moved the "info" to the right and I want something where it was to act as a link/button on the left. So basically lower left right below the table itself. Any ideas?
This discussion has been closed.
Replies
[code]$('#'+tableID).parents('.dataTables_wrapper').find('.dataTables_info').css({"clear":"none","margin":"6px"}).after('Refresh');[/code]
There are a couple of ways of doing what you want:
1. You could use TableTools, which is designed specifically to allow flexible buttons to be added to DataTables
2. Create a feature plug-in to add a button using sDom (and then positioning would be with a bit of CSS)
3. Do what you did :-)
Regards,
Allan