-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Conditonally rendering columns in DataTable with v-if is throwing error #719
Comments
Hello @redsuperbat , have you considered using a Breakpoint class with PrimeFlex? https://primefaces.org/primevue/showcase/#/display
I haven´t tested myself on a DataTable, but I believe should be straightforward. |
Hey @dheimoz! Thanks for your response. I will definitely check that out! However I think using vue's built in rendering should be something that works with DataTable since it is a core feature of vue and this library is targeting the vue framework. |
It should definitely be possible to do this. I have just run into this when trying to create a DataTable that I wish to respond to whether or not the current user has permission to edit it or not. As it stands it was simpler and easier to create another DataTable to have one with editing capabilities and one without. I am not sure if it belongs in the same issue, but this also does not work when trying to use v-if on a ColumnGroup. |
I've run into this issue as well where I use Datatable on multiple pages but need to conditional set things like row selection, edit, expand etc. Running into major problems as its too deep to create multiple Datatables for each condition and defeats the purpose of a component. |
Hi! What about this issue @cagataycivici? I think that this feature is a must, I you try to conditionaly hidde a column (with Maybe an attr like |
Hi guys, Finally I've implemented this feature in my fork of this lib: mllull@e3aeaf3 I haven't created a PR basically for two reasons:
I have also added examples in docs. Enjoy it if you want! 😊 |
I got bit by this today too. I'll follow @WhyKickAmooCow advice for now and create a copy of my existing DataTable. |
All PR's always welcomed. Please feel free to create PR. Also PrimeVue has similar concept ColToggle |
@tugcekucukoglu I already had a look a at dynamic columns (which ColToggle uses) but couldn't figure out how to conditionally render more advanced However, I found out that you can conditionally render
It looks quite odd and not sure if this is the intended behavior, but no extra |
@AndreasNasman the
So, today there is no way of conditionnally toggling an individual Column except by using some CSS/styling trick. |
Hi, I made some changes in the computed columns method. Could you please try the following link? Note: Please check DataTable.computed.columns = function () { in main.js |
sm is just a boolean that checks the screenwidth. I want to conditionally render columns but it throws the error below.
The text was updated successfully, but these errors were encountered: