Skip to Content
Mar 26, 2015 at 09:11 AM

How to change odata model data with expanded data?


I have the following odata structrue: appointment, and every appointment has attachments, but the attachments data will be deferred.

Usually I get appointment data with deferred attachments data firstly.Then, I would send a batch request to get all the data for the detail view. One of the requests is to expand attachements data.

The question is how to access the previous odata model and change it with expanded data? The following is my piece of code, but it doesn't work.

// submit the batch reqeust and get the batch response
// access and change the model with expanded data in batch request call back function
var sPath = "/AppointmentSet(guid'" + appointmentID + "')";
var oModel = this. getView().getModel();

In Chrome debug mode, I checked that didn't change at all.

Any help is appreciated!