2011-07-14 36 views
1

似乎在使用模型/存儲對象中的其餘代理加載特定實例(load()函數)時出現問題。例如:Sencha Touch - RESTful load()特定實例URL的問題(商店/型號)

代碼:

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 
    } 
}); 

此代碼是從煎茶觸摸的API複製。生成的網址是http://localhost/users?_dc= ...而不是所需的(並記錄在案的)網址http://localhost/users/123

當使用帶參數的store.load時,也會發生這種情況。

我在這裏做錯了什麼? 謝謝 T

回答

0

它接縫的id參數已被記錄,但沒有實現。這已在sencha論壇[link]中討論過。在#8和#13後寫了一些非完整的修復。