Skip to Content
0
Former Member
Jun 26, 2015 at 06:46 AM

Question for TreeTable, child-nodes and dynamic list of columns

588 Views

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