Hi,
I am using latest jet and cardova. I wan to call a custom api from mcs backend and sync it with a collection. I am able to call my mcs service. But I am not able to sync it with collection. I am trying to use the "sync" of oj.Collection
function reqCollectionSync( ) {
mcsBackend.MobileBackend.CustomCode.invokeCustomCodeJSONRequest("REQ/requisitions?number=ALL","GET",{},
function (status,data,header) {
console.log('call success');
console.log(data);
},
function (statusCode, data) {
console.log('failure');
});
};
self.reqCollection = new oj.Collection(null,{
// url not required when using sync
model: self.reqModel,
comparator: "Id",
sync : reqCollectionSync()
});
self.reqData = ko.observable(new oj.CollectionTableDataSource(self.reqCollection ));
This is how I am calling the service. I am able to see the logs of my success callback and i am able see the valid response data in the console log. Now how to map the response data on the collection ?. Is there any better way to achieve the same ? Please help me with this. I am stuck at this point.