Vuetable-2: Hide column?

Created on 15 Nov 2017  路  2Comments  路  Source: ratiw/vuetable-2

Hello there!
First off, I just wanted to say that I absolutely adore the software that you all have made, it works really well.

My only issue is that I have 2 modes: admin, and normal user. The only difference is that one column is hidden. Is there any way to dynamically hide a certain column?

Thanks!

Most helpful comment

Hi @mitymarcus It's possible to do that but there is one caveat
http://jsfiddle.net/z11fe07p/2681/

You have to call a method which re-renders table columns in case the table was already rendered.

toggleColumn() {
    this.nicknameColumn.visible = !this.nicknameColumn.visible
    this.$refs.vuetable.normalizeFields()
},

In case you know that a column will be displayed/hidden from the start, you could simply add the property visible: false on the column based on the user role

All 2 comments

Hi @mitymarcus It's possible to do that but there is one caveat
http://jsfiddle.net/z11fe07p/2681/

You have to call a method which re-renders table columns in case the table was already rendered.

toggleColumn() {
    this.nicknameColumn.visible = !this.nicknameColumn.visible
    this.$refs.vuetable.normalizeFields()
},

In case you know that a column will be displayed/hidden from the start, you could simply add the property visible: false on the column based on the user role

Wow, you are incredible at supporting the project! Thanks for all the help, it works perfectly!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

anselmobattisti picture anselmobattisti  路  5Comments

larryu picture larryu  路  6Comments

hjJunior picture hjJunior  路  3Comments

kawamataryo picture kawamataryo  路  3Comments

legreco picture legreco  路  5Comments