Vuetable-2: Is there a way to dynamically re-render table?

Created on 29 Jan 2018  路  2Comments  路  Source: ratiw/vuetable-2

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?

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 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

All 2 comments

@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

Was this page helpful?
0 / 5 - 0 ratings

Related issues

flyingcoder picture flyingcoder  路  3Comments

jdriesen picture jdriesen  路  4Comments

ericksongmr picture ericksongmr  路  5Comments

hjJunior picture hjJunior  路  3Comments

PrimozRome picture PrimozRome  路  5Comments