on ‎2019 Feb 18 4:17 AM
Hi everybody,
I would like to modify the model in the controller. js by using
var oSelectedIndex = oTable.getSelectedIndex();
var row = oTable.getRows()[oSelectedIndex];
I do not know how to preceed?
How can I update the model for the selected row?
Many thanks
Regards
Mario
Request clarification before answering.
For UI.Table to update the data you need to follow the below method unlike the normal m.table. first you need to call below to get all selected lines( incase of multiple)
var aSelectedIndices = oTable.getSelectedIndices()Now you loop on the aSelectedIndices and then call the below method
var oContext = oTable.getContextByIndex(iSelectedIndex);Once you get the context of that row, get the path and update the property
var sPath = oContext.getPath();
oContext.getModel().setProperty(sPath +"/PropertyName", sValue);BR,
Mahesh
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Mahesh,
thanks for your reply. The good news: I do not have a syntax error.
But my table get's not update. Do I have to call some kind of "refresh"-method?
Best Regards
Mario
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
| User | Count |
|---|---|
| 5 | |
| 5 | |
| 3 | |
| 3 | |
| 3 | |
| 3 | |
| 2 | |
| 1 | |
| 1 | |
| 1 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.