Skip to Content
avatar image
Former Member

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

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");


Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

1 Answer

  • Mar 06, 2018 at 02:36 PM


    Why don't you use the setHighlight method?

    Add comment
    10|10000 characters needed characters exceeded