on 01-06-2015 4:28 PM
Hi All,
I want to add extra row in table after rendering of table. Is there any way to add extra row after table is bind to model.
I can do DOM manipulation if I get onAfterRender event of table. But in specification I didn't find any such event.
I am able to add columns in table also they are bound to model.Once data is bound base on some calculation I have to add extra row in bottom of table. Bottom row is nothing but summation of data shown in top rows.
Any help is appreciated
Thanks in advance.
not sure about the event.. but you could add the object to your model and then do a refresh which would cause the same behavior. a new row should be added at the bottom of your table.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Every control supports onAfterRendering. You can attach a handler via the addEventDelegate method.
However, note that adding an extra row cannot be done via addRow, the table has to be model driven. So you can either add the data to the model (as suggested by Sergio above; also my recommendation) or you need to manipulate the DOM directly.
But if you want to add a total, you might want to look into the AnalyticalTable control, I believe it has native support for such a feature.
- Max
onAfterRendering method is not present for table control.
I have added this but it fails in rendering table UI with fixedColumnCount property set.
as
myTableControl.onAfterRendering = function(){
console.log("Called after Rendering");
};
Because of this table is not render properly.
But when I comment this function, it works properly.
I think sapui5 do something in onAfterRendering method.
which I override by above function causing failed in rendering table control.
Is there any other way by which I can call onAfterRendering event after sapui5 rendering event fire.
As you mention use of "addEventDelegate", can you provide any sample how code is written? I have checked
addEventDelegate(oDelegate, oThis?) but I didn't understand it properly, how could I add on after render method for table with this?
Here's an example of the usage of addEventDelegate. Instead of onfocusin, you can simply use onAfterRendering: JS Bin - Collaborative JavaScript Debugging</title> <link rel="alternate" type=&q...
Also, you can overwrite onAfterRendering as you did above, but you'll need to invoke the default implementation via sap.ui.table.Table.prototype.onAfterRendering.apply(this, arguments); before invoking any custom logic (e.g. console.log).
Note that addEventDelegate is the preferred approach.
- Max
Hi Vikash,
this could happen for a number of reasons...
- When/where do you call addEventDelegate? Ideally, it should be called from a controller's onInit function.
- How did you determine that the callback is not triggered? Set a breakpoint into the callback to make sure that it is actually not being triggered and that it's not just your code inside the callback that might not be working.
Regards,
Max
declare any method to UpdateFinished property of Table and do validations in that method.It worked for me earlier related to validations after rendering table.
Regards,
Koti Reddy
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
85 | |
10 | |
10 | |
9 | |
6 | |
6 | |
6 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.