njleonzhang / vue-data-tables

A simple, customizable and pageable table with SSR support, based on vue2 and element-ui
https://njleonzhang.github.io/vue-data-tables
MIT License
1.02k stars 221 forks source link

How to hide spesific column? #226

Closed akbarsaputrait closed 5 years ago

akbarsaputrait commented 5 years ago

Online reproduce

https://www.njleonzhang.com/vue-data-tables/#/en-us/event

Expected Behavior

Add the hidden spesific column feature please.

Current Behavior

I cant hide my spesific column

Steps to Reproduce

-

Detailed Description

-

Motivation / Use Case

I need to hide my spesific column, and add some action button also when i click it, will return the the value of column that i hide.

Expected Behavior

I cant hide my spesific column, like some id of my data

Other Information

njleonzhang commented 5 years ago

It seems el-table itself doesn't have this feature. I think you can hide the content of the column, and then show it after click some button as a workaround.

akbarsaputrait commented 5 years ago

So, if i have a data like this { id: 1, name: "Inventory 1", store: "Store A", space: "Space A", qty_in: "10", qty_out: "5", } i just need to doesn't set prop: id to hide the id value ,right?

and then, if i need to get the id value, just like this props.row.id right??

njleonzhang commented 5 years ago

I have just tried, you can implement via v-if on el-table-column, sample:

http://jsfiddle.net/zpczjl/a72oqevy/2/

Anyway, this is a el-table problem, not related to vue-data-tables