Quantcast
Channel: SCN: Message List - SAP Fiori
Viewing all articles
Browse latest Browse all 2526

Table Refreshment issue

$
0
0

Hello folks,

 

Displaying customer list in a table in 1st screen off the app. when i select a customer from table, navigating to 2nd screen which again contains a table.

 

i am applying diff colours to 2nd screen table rows depends on colour code(colour code is coming from backend all the times along with data). these colours are not refreshing properly.

 

below is my code:

 

_applyColorS : function(oData){

 

  var oTable = this.byId("cusMonSubId"); // second table id(new view)

 

   

    oTable.onAfterRendering = function() {

     if (sap.m.Table.prototype.onAfterRendering) {

       sap.m.Table.prototype.onAfterRendering.apply(this);

     }

    

     var items = this.getItems();

     for (var i = 0; i < items.length; i++) {

       var item = items[i];

       var obj = item.oBindingContexts.weeklySubDate.getObject();

       item.$().removeClass("red");

       item.$().removeClass("yellow");

       item.$().removeClass("green");

       if(obj.Color_S == "2"){

       item.$().addClass("red");

       }else if(obj.Color_S == "1"){

       item.$().addClass("yellow");

       }else if(obj.Color_S == "0"){

       item.$().addClass("green");

       }else{item.$().addClass("none");}

       }

     }

 

  }

 

Note:  every time i am doing $ajax call to get data and color code from backend in onInit: function()

 

 

please help me on this.


Viewing all articles
Browse latest Browse all 2526

Trending Articles