Reputation: 11
While I have successfully created a simple project using the table object and the function onAfterRendering, I realized that just implementing the onAfterRendering function changes the appearance and disables some functions of the table object. The header becomes misaligned with the columns, the left row selectors are bunched up and the scrollbar does not work.
I have seen this happen on any table object that I have tried. As an example, I took SAP's Fixed Columns Example from the SDK, added the onAfterRendering function with no contents and see the problem. I changed the column width to 50px or 100px which causes the problem to be more obvious.
I'm implementing the function following the placeAt statement. I'm using Eclipse Luna with SAPUI5 1.24.4.
//Bring the table onto the UI
oTable2.placeAt("sample2");
oTable2.onAfterRendering = function(){
};
Upvotes: 1
Views: 10115
Reputation: 1926
You should use the addEventDelegate method to register such functions.
oTable.addEventDelegate({
onAfterRendering: function() {
// ...
}
}, this);
In your way you are overwriting the complete onAfterRendering of the control itself.
Upvotes: 15