I want to implement the ability to select columns, above the table I add checkboxes with allowed fields and when checkbox selected I'm appending a new field to current datatable fields but I need also somehow to re-render table to add an extra column. Is there a way to do so?
@bogdan-dubyk What you have to do is actually hide the column you don't want to display at the beginning, then displaying hidden columns when its checkbox is checked.
You can also check out the available example which already has demonstrated this functionality by
cloning this repo and npm install && npm run dev
@ratiw Thanks for the reply! Well, in addition, I need to send those new columns to the backend and query data by them only if they visible, so my solution what I'm found is to append new columns to fields object and then run this.$refs.vuetable.normalizeFields(); Vue.nextTick(() => this.$refs.vuetable.refresh());. Oh and also I'm addin those new columns to append-params
Most helpful comment
@ratiw Thanks for the reply! Well, in addition, I need to send those new columns to the backend and query data by them only if they visible, so my solution what I'm found is to append new columns to
fieldsobject and then runthis.$refs.vuetable.normalizeFields(); Vue.nextTick(() => this.$refs.vuetable.refresh());. Oh and also I'm addin those new columns toappend-params