Skip to Content
avatar image
Former Member

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

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.

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

2 Answers

  • Best Answer
    avatar image
    Former Member
    Nov 23, 2016 at 10:18 AM

    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

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Dec 03, 2016 at 07:38 AM

    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.

    Add comment
    10|10000 characters needed characters exceeded