PDA

View Full Version : Load() specific instance model/store URL building



tpac
14 Jul 2011, 9:24 AM
It seems there is a problem with loading a specific instance (load() function) using the rest proxy in a model/store object. example:

Ext.regModel('User', {
fields: ['id', 'name', 'email'],

proxy: {
type: 'rest',
url : '/users'
}
});

//get a reference to the User model class
var User = Ext.ModelMgr.getModel('User');

//Uses the configured RestProxy to make a GET request to /users/123
User.load(123, {
success: function(user) {
console.log(user.getId()); //logs 123
}
});
This code is copied from the API. the generated URL is http://localhost/users?_dc=... instead of the desired (and documented http://localhost/users/123.

it also happens when using the store.load with a parameter.

Am I doing something wrong here?
Thanks
T

tpac
16 Jul 2011, 2:10 PM
BumpBump

tpac
21 Jul 2011, 12:43 AM
bump bump?

tpac
27 Jul 2011, 2:34 AM
it seems this problem is back dated to January: thread (http://www.sencha.com/forum/showthread.php?122595-Model.load-not-sending-id-loading-all-models).