tPac
tPac

Reputation: 21

Sencha Touch - RESTful load() specific instance URL problem (Store/model)

It seems there is a problem with loading a specific instance (load() function) using the rest proxy in a model/store object. example:

Code:

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 Sencha touch's API. the generated URL is http://localhost/users?_dc=... instead of the desired (and documented) url http://localhost/users/123.

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

Am I doing something wrong here? Thanks T

Upvotes: 2

Views: 450

Answers (1)

fsto
fsto

Reputation: 63

It seams the id parameter has been documented but not implemented. This has been discussed in the sencha forum [link]. A few non complete fixes are written in post #8 and post #13.

Upvotes: 1

Related Questions