Skip to Content
0

How to disable collapse of nodes in SAP UI5 tree table

Feb 14, 2017 at 02:02 PM

245

avatar image

Hi Everyone,

When I open tree table, I am expanding tree to all nodes by default. I don't want user to collapse nodes.

Could anyone please suggest how to disable collapsing nodes option in sap.ui.table.treeTable control.

Thanks,

Best Regards,

Viswanath

10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

2 Answers

Best Answer
Viswanath Golakoti Feb 24, 2017 at 09:17 AM
0

Hi,

I found other option to disable by overriding CSS class of tree icon(Arrow icon to expand or collapse)

.sapUiSizeCompact .sapUiTableTreeIcon, .sapUiSizeCozy .sapUiTableTreeIcon {
       pointer-events: none; !important;
   
} 

Thanks,

Best Regards,

Viswanath

Share
10 |10000 characters needed characters left characters exceeded
Pierre Dominique Feb 14, 2017 at 03:18 PM
0

Hi,

Well I guess you could extend the control or the TableRenderer but you should probably not do it. Here's where the tree icon is added in TableRenderer.js

TableRenderer.renderTableCellControl = function(rm, oTable, oCell, bIsFirstColumn) {
	if (TableUtils.Grouping.isTreeMode(oTable) && bIsFirstColumn) {
		var oRow = oCell.getParent();
		rm.write("<span class='sapUiTableTreeIcon' tabindex='-1' id='" + oRow.getId() + "-treeicon'");
		oTable._getAccRenderExtension().writeAriaAttributesFor(rm, oTable, "TREEICON", {row: oRow});
		rm.write("> </span>");
	}
	rm.renderControl(oCell);
};

Expand all node by default and let the user decide if he/she wants to expand or collapse nodes.

Cheers,

Pierre

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

Hi,

Thanks for your response.

the reason why I want to disable collapse button is ,when I collapse the nodes and Expand it again selection is gone.

Could you please help how can I resolve this issue.

Thanks,

Viswanath

0