Datatable

patchPT pro premium asked 4 months 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 4 months 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 pro premium commented 4 months 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 4 months 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.


patchPT pro premium answered 2 months ago

This issue is now fixed in version 1.

Thanks MDB


Please insert min. 20 characters.
Status

Resolved

Specification of the issue
  • User: Pro
  • 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