ratiw / vuetable-2-tutorial

MIT License
258 stars 67 forks source link

Is it possible to reload the custom actions every time the page is changed? #124

Closed dybm27 closed 4 years ago

dybm27 commented 4 years ago

I am creating events with vue-events in the created and mounted of each custom action in my table differentiating by the id.

created() { this.$events.$on(this.rowData.id + "-blockBtnsNoticia", e => this.blockBtnsNoticia() ); this.$events.$on(this.rowData.id + "-unlockBtnsNoticia", e => this.unlockBtnsNoticia() ); }

mounted() { this.$events.fire( this.rowData.id + "-checkBlockBtnsNoticia", this.rowData.id ); }

this in order to be able to block the buttons through websockets when another person accesses them.

everything works fine when I'm on the first page. image

but when going to the next page, this doesn't work, because the custom buttons don't update and the created and mounted methods don't execute and keep the events of the previous page, that is, page 1..

Is there a way to update custom actions every time the page is changed? .. so that the created and mounted method of the custom actions is executed.

I appreciate any solution to this problem.