I am trying to create a tree table from an EntitySet (say E1), in my FIORI App.
I have my controller and extended View and the data is properly bound between the two.
I am referring to the Official SAP Demo Explored Kit for the tree table code.
There, they are taking 5 parameters as input, as JSON. Sample data for the root node:
{ "NodeID": 1, "HierarchyLevel": 0, "Description": "1", "ParentNodeID": null, "DrillState": "expanded" },
Now, I don't have the "DrillState" field in my OData EntitySet. What is the purpose of this field and will my tree appear properly without it? I can hardcode the logic if required.
Currently I am not passing the "DrillState". And my Output looks weird. It's just a normal table without the tree structure and all are at the same level (But the first column does have the "expand or collapse" button attached to it, but it serves no purpose).
Following is my XML Code:
<table:TreeTable
id="treeTable"
selectionMode="Single"
enableColumnReordering="false"
expandFirstLevel="false"
rootLevel="01"
useGroupMode="false"
rows="{
path: '/ZSC',
parameters : {
countMode: 'Inline',
treeAnnotationProperties : {
hierarchyLevelFor : 'tree_level',
hierarchyNodeFor : 'Node',
hierarchyParentNodeFor : 'parent'
}
}
}">
<!-- add drill state in property and path also-->
<table:columns>
<table:Column label="Hier_ID">
<table:template>
<Text text="{Hier_ID}"/>
</table:template>
</table:Column>
<table:Column label="tree_level">
<table:template>
<Text text="{tree_level}"/>
</table:template>
</table:Column>
<table:Column label="Node">
<table:template>
<Text text="{Node}"/>
</table:template>
</table:Column>
<table:Column label="parent">
<table:template>
<Text text="{parent}"/>
</table:template>
</table:Column>
</table:columns>
</table:TreeTable>
Where am I going wrong? Or do I have to do map it in a different way since I am taking data from an entity set and in tutorial they are directly passing as JSON object