Skip to Content

How to change color of row in SAP UI Table depending on value of particular field.

Feb 14 at 11:58 AM


avatar image
Former Member

The color change will happen on button event and selected row should get the new color.

The problem with my code is that the color is getting reflected even when it is scrolled down. As the color is applied on Domref. How to reflect it on particular row.


onDeleteItem: function() {
			var that = this;
			var oTable = this.getView().byId("IDOrderOverviewTable");
			var oNewTable = oTable.getSelectedIndices();

			if (oNewTable.length !== 0) {
				for (var i = 0; i < oNewTable.length; i++) {
					var oSelectedEntry = oTable.getContextByIndex(oNewTable[i]);
					var oDelSAP = oSelectedEntry.getProperty("DelSAP");
					if (oDelSAP === "X") {"Data is Deleted");
					else {
	oNewTable.forEach(function(Line) {
					oTable.clearSelection();"Data is available in SAP");

			 else {"Please select atleast one row");


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

1 Answer

Iftah Peretz
Mar 06 at 02:36 PM


Why don't you use the setHighlight method?

10 |10000 characters needed characters left characters exceeded