cancel
Showing results for 
Search instead for 
Did you mean: 

Change Sap.m.table binding dynamically between odata and JSON models

Former Member
0 Kudos

Hi ,

I have this requirement to toggle the  displayed data in a sap.m.table on click of a button within two different models .

At first the data is bound to a Odata service , but when the user clicks 'add' button in toolbar , the table should go blank, and provide

just a empty table , with a line to insert data - this data will be added to the backend. Now if user decides to discard his entries in the add mode , the table should switch back to display the previously displayed entries.Right now , I'm setting the model of table to a named json model with a empty entry  when the ADD button is clicked , and calling bindItems() method to display the empty row .

Can anyone help me with a sample code to accomplish the switch back to the odata model?

Accepted Solutions (0)

Answers (1)

Answers (1)

junwu
Active Contributor
0 Kudos

that is not requirement, that's just ur design

just use json model. no need two model