Add a button in the pagination section
Add a button in the pagination section
Hi Colin. I am trying to add a button in the pagination section on the right, next to the 'next' link. i tried doing so in initComplete function by using insertAfter function like so $("button to be inserted").insertAfter('#next link id in pagination'). it worked but of course once i get to the next page, it disappears. What is the best way to insert a button in the pagination area. i tried Dom too but it's not working since DOM doesn't let me insert the element in the p area.
Thank you
Answers
A clunky option would be to re-add the button again every time you change page, which you can detect with the
page
.A tidier solution would be to add the button into the pagination control. This link here shows some other pagination plug-ins that you could use a template,
Colin
The
dom
option is the way to do that, although you'll need a little CSS as well: https://live.datatables.net/nakakuju/1 .Note that the output view needs to be wide enough for DataTables' CSS not to collapse the controls down.
Allan