Adding entity attributes to table at runtime

Hi,

i thought of the possibility if it would be possible, that a user is able to expand the columns in a table at runtime. Exactly like one can do with presentations. The difference is, that in presentations you have a fixed set of columns that are predefined. The user is only allowed to cut off some of these columns with a presentation (or, if the default presentation contains less columns than available, the user can expand the number of columns up to the predefined limit from the view).

What i was thinking of is, if it is possible and although if it would make sense to not pre-define a set of columns. From my example app cuba-ordermanagement, here is an example that i would think of: order-browse.xml. In this case, the Order has a N:1 Relation to a customer. This customer has a city attribute. Would it be possible to enable the user to get a order list, where the city of the user is shown as a column, without changing the code of the order-browse.xml and the view associated with it?

The user could select columns like in the “Add filter” popup, where there is the tree of the entity-graph attributes that the user can pick from.
I’m not sure if this even make sense, but i would like to know what you think about it and if it even would be possible in terms of database fetching. Obviously there is always the possibility to add a lot of columns to the view and create a default presentation that just contains the starting points, but that would require to know about the requested table upfront (and probably).

Bye,
Mario

Hi Mario,

Your idea reminded me about the ticket in our issue tracker created more than three years ago: “Remove the hidden in table attributes from the view when loading the datasource for the table”. The ticket’s goal was to improve performance by not loading unneeded data, especially linked entities that require SQL joins. Your goal is to give more flexibility to a user to view arbitrary data. But from the implementation point of view these tasks require almost the same: ability to modify the view which is used to load the datasource depending on columns selected by the user. It seems quite feasible, and we will include it to the roadmap.
Thanks for the idea, it’s always better to kill two birds with one stone :slight_smile:

Hi Konstantin,

that sounds great. I’m really looking forward to this. The only difference to the above mentioned “removing columns from query” is, that on the UI it requires a little more sophisticated mechanism to select the columns from related entities (like the filter selection popup as i said) then it is currently the case with the column hidden possibility. But i think you will come up with a great idea to present it to the users.

Bye
Mairo

Hi
Is there any further news about this feature? I’m in need such functionality.

Mortoza

It’s on our roadmap, but without exact timing yet.
BTW, if you need dynamic (runtime) attributes in your entities, have a look at the Dynamic Attributes functionality: https://doc.cuba-platform.com/manual-6.0/dynamic_attributes.html

:ticket: See the following issue in our bug tracker:

https://youtrack.cuba-platform.com/issue/PL-6655