cancel
Showing results for 
Search instead for 
Did you mean: 

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

Former Member
0 Kudos

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.

Accepted Solutions (1)

Accepted Solutions (1)

tom_parsons
Participant
0 Kudos

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

Answers (1)

Answers (1)

Former Member
0 Kudos

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.