on 06-26-2015 7:46 AM
Dear all,
we are trying to use the SAPUI5 TreeTable with a JSON model (the support for a direct OData model seems not to be good enough yet).
We have to use a dynamic list of columns with dynamic names. A dynamic list of columns is possible via bindColumns/bindAggregation. For the column-creation we are using a factory-method. The path for the column-template-binding has to be created dynamically. So far ok.
But our for each row the values of the dynamic columns shall be stored in a object so that the JSON would look like:
-nodes (Object)
--Nodekey (Attribute)
--Text (Attribute)
--Icon (Attribute)
--Tooltip (Attribute)
---Child (Object)
----...
---COLUMN_1 (Object)
----ColumnName (Attribute)
----IconName (Attribute)
----Text (Attribute)
----Tooltip (Attribute)
----Nodekey (Attribute)
---COLUMN_2 (Object)
----ColumnName (Attribute)
----IconName (Attribute)
----Text (Attribute)
----Tooltip (Attribute)
----Nodekey (Attribute)
---COLUMN_N (Object)
...
These column node have to be underneath the node-date itself - otherwise a direct (relative) binding is not possible. Unfortunately the TreeTable interprets every object/array underneath the node itself as a child node. Why? How can this be solved for us?
The only idea I have is to use the formatter-function and to return the right data manually. The COLUM-Objects then would be no direct childs.
Regards, Stefan
Hi Maksim,
here is my jsbin:
http://jsbin.com/yigubupote/edit?html,output
@Robin: In my example on jsbin you might see, that there is also a usecase to have other objects than thildrens underneath an node If you have an other solution for me, I will be very thankful
Best regards,
Stefan
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Stefan, why make things more complex than they should be
Hi Maksim,
you missed some column-details - tooltip, icon, ...
Right now, I "flattened" the ColumnNode-Objects, e.g.
COLUMNNAME__Tooltip
COLUMNNAME__Text
...
But I think the TreeTable (as it's built now), is not in a good development-state. Besides my problems, there are multiple other problems (e.g. expand/collapse/leaf-icon not shown correctly,...)
Regards,
Stefan
Well, as the name suggests, it's a Tree, so it makes perfect sense for any object or array under a parent node to be interpreted as child(s)
Looking at your JSON model for the rows, if you make it a flat structure for every row it should work
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Stefan, jsbin example would be more helpful
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
87 | |
10 | |
10 | |
10 | |
7 | |
6 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.