Skip to Content
0

Add several rows to odatamodel.V2 without posting to backend and display in SmartTable

Nov 23, 2016 at 10:04 AM

58

avatar image

Hello.

I need to create records in oDataModel and display them in SmartTable. After user press "Save" I need to SubmitChages or DeleteCreatedEntries.

When I try to add new entry to model (oModel.CreateEntry) it is not displayed in table (but exists in model with temporary key). I've tried to refresh binding ( SmartTable.getTable().getBinding("rows").refresh() ) but without success.

Could somebody advice how to add several rows to smarttable without posting to backend\server?

I use oDataModel V2 with TwoWay Binding.

ui5
10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

2 Answers

Best Answer
Tom Parsons Nov 23, 2016 at 10:18 AM
0

Hi Mikhail,

You need to copy your data into a JSON model and bind that to your table.

See here:

https://archive.sap.com/discussions/thread/3806776

Share
10 |10000 characters needed characters left characters exceeded
Mikhail Drazdou Dec 03, 2016 at 07:38 AM
0

Hello, Tom!

Thanks for you advise! The solution with JSON Model is easy to implement and support. My final solution uses JSON model to display records in the table, but CRUD operations get executed with ODataModel.

Now I'm able to add row to SmartTable(overview table) and display SmartForm(Details) with selected Entry\Entity. SmartForm context has binding to oDataModel and on context change it will update oDataModel and then JSON model.

Michael.

Share
10 |10000 characters needed characters left characters exceeded