Extjs 记录未更新

Extjs 记录未更新,extjs,extjs4,extjs4.1,extjs-mvc,Extjs,Extjs4,Extjs4.1,Extjs Mvc,我不熟悉Extjs,使用ExtJS4.1.1。我试图通过编辑(View-Edit.js)来更新记录(用户模型)。但是,当发送请求时,操作会在中途中止,并且无法完成。 是否需要编写额外的代码来保存,或者我的代码中存在一些缺陷 请在下面找到我的代码 app.js Ext.application({ name: 'AM', appFolder:'app', controllers:['Users'], requires:['AM.view.user.List','AM.Configur

我不熟悉Extjs,使用ExtJS4.1.1。我试图通过编辑(View-Edit.js)来更新记录(用户模型)。但是,当发送请求时,操作会在中途中止,并且无法完成。
是否需要编写额外的代码来保存,或者我的代码中存在一些缺陷

请在下面找到我的代码

app.js

    Ext.application({

name: 'AM',

appFolder:'app',

controllers:['Users'],

requires:['AM.view.user.List','AM.Configuration'],

launch:function(){

    Ext.create('Ext.container.Viewport',{
        layout:'fit',
        items:[{
                xtype:'userlist',
                title:'Users',
                html:'List of users will go here'
            }   
        ]
    });
}});
型号

Ext.define('AM.model.User',{
extend:'Ext.data.Model',
fields: ['id','name','email']});
商店

Ext.define('AM.store.Users',{
extend: 'Ext.data.Store',
model: 'AM.model.User',
autoLoad: true,
idProperty:'id',

proxy:{
    type:'ajax',
    url: 'data/users.json',
    api:{
        read: 'data/users.json',
        update: 'data/updateUsers.json'
    },
    reader:{
        type: 'json',
        root: 'users',
        successProperty:'success',
    }   
}});
查看

    Ext.define('AM.view.user.Edit',{

extend: 'Ext.window.Window',

alias: 'widget.useredit',

title: 'Edit User',

layout:'fit',

autoShow:'true',

initComponent: function(){

        this.items = [{

                    xtype:'form',
                    items:[{
                        xtype:'textfield',
                        name: 'name',
                        fieldLabel: 'Name'
                    },{
                        xtype:'textfield',
                        name: 'email',
                        fieldLabel: 'Email'
                    }]
            }];

        this.buttons = [{
                text:'Save',
                action:'save'
            },{
                text:'Cancel',
                scope:this,
                handler: this.close
        }]

    this.callParent(arguments);
}});  
控制器

    Ext.define('AM.controller.Users',{
extend: 'Ext.app.Controller',

views:['AM.view.user.List','AM.view.user.Edit'],

requires:['AM.view.user.List'],

stores:['Users'],

models:['User'],

init: function(){
    console.log('Initialized Users!! This happens before the application launch function is called');   
    this.control({

        'userlist':{
             itemdblclick: this.onEditUser
        },
        'useredit button[action=save]':{
            click: this.updateUser
        }

    });
},

onEditUser: function(grid,record){
    console.log('called on Edit User.. for user '+record.get('name'));
    var view = Ext.widget('useredit');
    view.down('form').loadRecord(record);
},

updateUser: function(button){
    console.log('Clcked save button');
    var win = button.up('window'),
    form = win.down('form'),
    record = form.getRecord(),
    values = form.getValues();

    record.set(values);
    win.close();
    this.getUsersStore().sync();
}});

尝试添加到存储代理:
writer:new Ext.data.JsonWriter()

grid.insert(rowIndex,[values])

“在中间”是什么意思?您卡在哪里?@sra:保存时,我可以看到POST请求正在进行,但没有响应,在firebug中显示“已中止”。我认为您的服务器代码有问题,请检查使用POST请求和响应标题发送的数据。通常在超时时会出现中止状态。检查服务器响应所用的时间或为AJAX请求设置的超时。@vyacheslavoronchuk:我正在使用hfs服务器和静态json进行响应