cancel
Showing results for 
Search instead for 
Did you mean: 

SAP UI5 - sap.m.table force rerender/onAfterRendering

0 Kudos

Hello,

I am working on coloring rows in my table depending on the data and doing the check in the controller of my XML view.

I noticed, that SAP UI5 will not call the onAfterRendering method on the Table, if I reload it with other data, but the same number of rows.

Is there a way to force to call the onAfterRendering method on my table?

oTable.addEventDelegate({
"onAfterRendering": function() {
//Color Rows
var aItems = oTable.getItems();
var i;
if (aItems && aItems.length > 0) {
for (i = 0; i < aItems.length; i++) {
var aCells = aItems[i].getCells();
if (aCells[3].getText() === "Load PORT") {
aItems[i].addStyleClass("rowBackground");
}}}}
}, this);

Accepted Solutions (0)

Answers (2)

Answers (2)

irfan_gokak
Contributor
0 Kudos

You can do this thing onAfterRendering method of a view not the table control.

Sharathmg
Active Contributor
0 Kudos

No, you cannot call the onAfterRendering. These are standard hook methods.

For your purpose of handling the coloring of the table based on data, you need to handle with some other events.

Regards,

Sharath