Skip to Content
0

Issue in the TreeTable of Sapui5

Jun 01, 2017 at 05:32 AM

158

avatar image
Former Member

Hello Experts,

please, how could I fix a problem in the TreeTable, when it keeps showing "arrows" to expand the next level, even when it is the last one.

I suppose it is due to the metadata in the model, and could work properly if I clear each __metadata. As I'm not sure if it is the best solution for this problem, or if I could have problems latter for cleaning metadatas, would you have another idea?

Follows a part of the code and a print screen. Thank you!

var oFirstTemplate = new sap.m.ObjectIdentifier().bindProperty("text", {
	parts: [{
		path: "CustomerID"
	}, {
		path: "OrderID"
	}],
	formatter: function(CustomerID, OrderID) {
		if (OrderID) {
			return "";
		} else {
			return CustomerID;
		}
	}
});

var oTreeFirstColumn = new sap.ui.table.Column({
	label: "CustomerID",
	template: oFirstTemplate
		// template: "CustomerID"
});

var oTreeSecondColumn = new sap.ui.table.Column({
	label: "Name",
	template: "ContactName"
});

var oTreeThirdColumn = new sap.ui.table.Column({
	label: "Order Id",
	template: "OrderID"
});

var oTreeTable = new sap.ui.table.TreeTable("idTreeTable", {
	columns: [
		oTreeFirstColumn,
		oTreeSecondColumn,
		oTreeThirdColumn
	],
	selectionMode: sap.ui.table.SelectionMode.Single,
	enableColumnReordering: true,
	expandFirstLevel: true
});

oTreeTable.bindRows({
	path: "/Customers",
	parameters: {
		expand: "Orders",
		arrayNames:["Orders"],
		navigation: {
			"Customers": "Orders"
		}
	}
});

duvida.png (15.6 kB)
10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

4 Answers

Best Answer
avatar image
Former Member
Jun 05, 2017 at 05:16 AM
0

HI Rogerio

The easiest way is to reorganize your data

example https://jsbin.com/mozezav/edit?html,output

Show 1 Share
10 |10000 characters needed characters left characters exceeded
Former Member

Hi Dennis, it worked. Thank you for your help

0
avatar image
Former Member Jun 02, 2017 at 08:00 AM
0

Dear @Moderators,

would you have some tip or idea about how to solve this problem?

Thanks

Share
10 |10000 characters needed characters left characters exceeded
Jun Wu Jun 02, 2017 at 12:25 PM
0

probably you don't have other option.

Show 1 Share
10 |10000 characters needed characters left characters exceeded
Former Member

Thanks Jun

0
Nigel James Feb 28 at 02:19 AM
0
Show 1 Share
10 |10000 characters needed characters left characters exceeded
Former Member

It has worked with the Dennis' suggestion but I will also try yours.

Thank you Nigel!

0