Skip to Content
0

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

Aug 23, 2017 at 01:30 PM

80

avatar image
Former Member

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);
10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

2 Answers

Sharath M G Aug 23, 2017 at 03:00 PM
0

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

Share
10 |10000 characters needed characters left characters exceeded
Irfan Gokak Aug 24, 2017 at 09:28 AM
0

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

Share
10 |10000 characters needed characters left characters exceeded