load(id, [config])是静态的,将返回为您提供一个新的记录实例。它使用通过setProxy(proxy)设置的代理(也是静态的)。默认情况下,它将发送带有 params 的读取请求id: 123。静态方法允许您在可选配置对象中设置一些默认回调。需要这些回调来获取已加载记录(或错误)的实例。
这个怎么运作
// create a Model class
Ext.define('MyApp.User', {
    extend: 'Ext.data.Model',
    fields: [
        {name: 'id', type: 'int'},
        {name: 'name', type: 'string'}
    ]
});
// apply a proxy instance
MyApp.User.setProxy(/*YourAjaxProxy*/);
// prepare a handler
var cb = function(model, op) {
    // log the new model instance
    console.log(model);
};
// get a instance
MyApp.User.load(123, {
    scope: this, // should be the scope of the callback (cb)
    success: cb
});
不是你需要的?只是评论...