Skip to content

Programaticaly Hide/Show Columns #22

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
fwarren opened this issue Nov 15, 2018 · 2 comments
Open

Programaticaly Hide/Show Columns #22

fwarren opened this issue Nov 15, 2018 · 2 comments

Comments

@fwarren
Copy link

fwarren commented Nov 15, 2018

How can I change column visibility after the page is loaded. I tried changing the 3rd column with column[2].visible = true but visibility did not change.

@syshex
Copy link
Contributor

syshex commented Nov 16, 2018

Hey! You can't at this moment.
Want to give it a try at a PR for that ?

@fwarren
Copy link
Author

fwarren commented Nov 16, 2018

I may do a PR at some point. I think you would have to specify column by number not title or name. It is possible to have a column show up multiple times and then you would only be able to toggle the first occurrence.

I have been able to toggle the column programaticaly. the reactive column data that is passed into the table is used to build a reactive data structure dispalyCols.

The first thing I did is added ref="mytable" to <vue-bootstrap-table> and then I toggle the visibility directly.

this.$refs.mytable._data.displayCols[2].visible = true

I know that directly manipulating a child component is not a best practice, but it works.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants