Robert
Robert

Reputation: 1192

Can I hide a tabulator column based on a condition?

I want to hide a tabulator column based on a condition. After looking over the tabulator documentation it doesn't seem possible, is that the case? For example, if user X is auth don't show column B.

Upvotes: 2

Views: 3221

Answers (1)

nrayburn-tech
nrayburn-tech

Reputation: 968

Without knowing your exact setup, all I can give you is a general solution.

To hide a column, you just need to call column.hide() where column is the column component. Another option is to call table.hideColumn('name') where name is the name of your column.

If you want to hide it during the creation of the table, you can set it in the column definition. {visible: false}

Here is an example showing both methods. https://jsfiddle.net/nrayburn/rsjopqfx/11/

Upvotes: 4

Related Questions