JET 3.1
Hi,
I'm attempting to call a REST api using the OjCollection and ojModel however I seem to be having a problem fetching single records.
The code below produces a call which looks like 'http://localhost:7006/../../rest/customers' rather than 'http://localhost:7006/../../rest/customers/100' which I'm expecting.
What am I doing wrong??
Andrew
var CustomerModel = oj.Model.extend({
idAttribute: 'custId'
});
var CustomerCollection = oj.Collection.extend({
url: 'rest/customers',
model: new CustomerModel,
fetchSize: 25
});
var customers = new CustomerCollection;
var custModel = new CustomerModel({'custId': params.custId}, customers);
var customer = custModel.fetch({
success: function(model, response, options) {
console.log("custModel.fetch success");
},
error: function(model, xhr, options) {
console.log("custModel.fetch error");
}
});