Skip to Content
avatar image
Former Member

UI5 - Tree Table not displaying properly

Hello,

I'm trying to fill tree table with oData Service. But it is displaying as normal table not as tree table.

Please Help.

Below is .js code for setting up tree table rows

	var tableCarrier = this.getView().byId("treeTable");
	tableCarrier.setModel(nav);
		
	tableCarrier.bindRows({
			path: "/results",
		parameters: {
			countMode: "Inline",
		treeAnnotationProperties: {					hierarchyLevelFor: "Hierarchylevel",
	hierarchyNodeFor: "Nodeid",
	hierarchyParentNodeFor: "Parentnodeid",
	hierarchyDrillStateFor: "Drillstate"
						}
					}
				});

Below is XML code of view

<table:TreeTable id="treeTable" selectionMode="None" enableColumnReordering="false" expandFirstLevel="false">
<table:columns>
	<table:Column label="Description">
	<table:template>
	<Text text="{Nodedesc}"/>
	</table:template>
	</table:Column>
	<table:Column label="HierarchyLevel">
	<table:template>
	<Text text="{Hierarchylevel}"/>
	</table:template>
	</table:Column>
	<table:Column label="NodeID">
	<table:template>
	<Text text="{Nodeid}"/>
	</table:template>
	</table:Column>
	<table:Column label="ParentNodeID">
	<table:template>
		<Text text="{Parentnodeid}"/>
	</table:template>
       </table:Column>
</table:columns>
</table:TreeTable>

below is oData Response

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

2 Answers

  • Nov 02 at 09:44 AM

    I know it's too late...but still. As per my understanding please use OData version 2 i.e. sap/ui/model/odata/v2/ODataModel

    Thanks,

    Best Regards

    Hemendra

    Add comment
    10|10000 characters needed characters exceeded

  • 18 hours ago

    I am also facing the same issue . Has anyone got any appropriate solution

    Add comment
    10|10000 characters needed characters exceeded