on 08-20-2020 12:43 PM
HI
I have af Table bound to a oData Association
<Table
id="costDistribution"
class="sapUiResponsiveMargin"
width="400px"
items="{ReservationToCost}"
>
...
When displaying existing data it works ok. But how do i add an empty row in order to provide the user the option to extend data? I have tried this without luck (itemData is not referenced...):
var oModelCost = Fragment.byId("popoverFrag", "costDistribution").getModel();
Log.info("Modelcost:");
Log.info(oModelCost);
var itemData = oModelCost.getProperty("ReservationToCost");
Log.info("Itemdata:");
Log.info(itemData);
var newRec = {
Resid: "",
Aufnr: "",
Disprc: "" };
itemData.push(newRec);
oModelCost.setData({ data: itemData});
}
Hi,
You can try using createEntry method of ODATA model to add new record.
Thanks,
Dhiraj M
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
Refer the Stackoverflow link. It is similar to your requirement.
https://stackoverflow.com/questions/48475197/button-to-add-new-row-in-sapui5-table
Regards,
Sharath
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
86 | |
10 | |
10 | |
9 | |
7 | |
7 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.