Topic: Datatable
patchPT premium asked 3 years ago
Expected behavior
Action buttons must allow click event even when switching datatables records page.
Actual behavior
When datatable loads first time, all action buttons work fine, but as soon I access page 2 or 3 then no more action button works.
Resources (screenshots, code snippets etc.)
https://mdbootstrap.com/snippets/vue/patchpt/3116283
Marcin Luczak staff answered 3 years ago
Hi,
This is because action buttons from the next pages are not presented to DOM at the time you invoke your setActions
function, and that's why only buttons from the first page have event listeners added. You should clear your listeners and invoke your setActions
function every time the page is changed. You can achieve that by adding a proper event listener to change page buttons.
Keep coding, Marcin
patchPT premium commented 3 years ago
Hi Marcin,
but in that case I have to refresh my actions on datatables sort, page up and down, records per page dropdown. Could you perhaps update the documentation where you have setActions [https://mdbootstrap.com/docs/b5/vue/data/datatables/#section-action-buttons]
to include more 10 rows so we can see a working example of actions with multiple pages.
Thanks, Fabio
Marcin Luczak staff commented 3 years ago
Thank you for this suggestion. Indeed render
event should probably be emitted on every datatable data change. We will take a closer look at that and add a fix in one of the incoming releases.
FREE CONSULTATION
Hire our experts to build a dedicated project. We'll analyze your business requirements, for free.
Resolved
- ForumUser: Premium
- Premium support: Yes
- Technology: MDB Vue
- MDB Version: MDB5 1.0.0-beta6
- Device: Desktop
- Browser: Chrome 91
- OS: Windows
- Provided sample code: No
- Provided link: Yes