Skip to Content
avatar image
Former Member

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

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);
Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

2 Answers

  • Aug 23, 2017 at 03:00 PM

    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

    Add comment
    10|10000 characters needed characters exceeded

  • Aug 24, 2017 at 09:28 AM

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

    Add comment
    10|10000 characters needed characters exceeded