Quasar: Dynamically change QDataTable columns.

Created on 9 Sep 2017  路  9Comments  路  Source: quasarframework/quasar

When I initially init columns with [] when this value is dynamically updated the data table just remains blank.

Most helpful comment

Switched to Vuetify.js, seems to have a better design.

All 9 comments

Hi,

Are you defining the columns before the component is rendered or after? If after, I believe that won't work. So, you need to draw on your data for the columns definition before the datatable is "created". In other words, only the rows are computed after the datatable is built. I am not 100% certain about that though, however looking at the component itself, that seems to be the case.

https://github.com/quasarframework/quasar/blob/dev/src/components/data-table/QDataTable.vue

Also in general, we'd rather have only bugs and suggestions as issues in the repos. So, please use either the forum or the gitter channel for questions. You'll get answers there for sure. Please just have some patience.

Thanks. 馃槃

Scott

Are you defining the columns before the component is rendered or after? If after, I believe that won't work.

I just wanted to reuse the same table for different sets of columns dynamically (by picking a concrete type from Select). I.e. to present different subclassed of a some parent class (a same subset of columns + some columns specific to a child class).

Also in general, we'd rather have only bugs and suggestions as issues in the repos. So, please use either the forum or the gitter channel for questions.

I just thought it seems to be a bug (at least my assumption is intuitive). OK, next I'll write in forum before opening any issue here.

So I need to create different data tables showing one of them.

Thanks.

Yeah, we can discuss your concerns and questions on the forum and if it is determined there is a bug, then you'll be requested to start one (or someone might even start one for you).

I just wanted to reuse the same table for different sets of columns dynamically (by picking a concrete type from Select). I.e. to present different subclassed of a some parent class (a same subset of columns + some columns specific to a child class).

You can do that, I believe you'd just need to define all the columns you will need and use only the ones you want at the time you want them. This is all very theoretical on my part, so take it with a grain of salt.

Scott

@ababo did you get any solution?, i am having the same issue.

Switched to Vuetify.js, seems to have a better design.

@abado If you can wait for the DataTable revamp you'll find the best design for data tables ;)

@rstoenescu do you have any ETA for the new datatable revamp? I can't wait to see the new features.

DataTable revamp is in progress for v0.15. It will include this. Thanks for your patience. No ETA yet.

Should have closed this some time ago as it's ready in v0.15 (not yet released though).

Was this page helpful?
0 / 5 - 0 ratings