Harry
Harry

Reputation: 193

Extjs 5 model id' is not concatenating with REST URL - working in Extjs 4.2

Sorry!! may be i was not clear, I modified the question, Actual problem is that 'I am setting the id on the model and it is working fine in Extjs 4.2' and i am able to print the id from within the model object on console but this 'id' is not concatenating with REST URL like 'rest/update/user/123'

I really need your help. In Extjs 4.2, I am posting a form data to a rest url (update using proxy in model class ), it was working fine and send the request to the server as:

rest/update/user/123

but in Extjs 5 same request is being interpreted as:

rest/update/user //without he id of the object

it does not send the id of the object in the REST CALL URL (id has value inside the object)

//here is proxy in the model

proxy: {
    type: 'rest',
    url: ' rest/update/user'  
}

//controller

var model = Ext.create('MyApp.model.User');

model.set('id', "123");  // please see here, i am adding the Id so it is not phantom

model.set('userName', "john");
model.save();

Please help!!

Thanks.

Upvotes: 0

Views: 1705

Answers (1)

Saki
Saki

Reputation: 5856

Model seems to be phantom (new). Call model.commit() before save.

Upvotes: 3

Related Questions