Ext RowEditor 的使用???

我用Ext3.0里面用到官方例子里的http://extjs.com/deploy/dev/examples/grid/row-editor.html这个例子,表格的增删改,但不知道怎么动态跟新数据,有没有做过这个的,望能指点。。 

写法参考官网示例

更新数据的参考我的

[code="js"]
var store = new Ext.data.Store({
url: 'getUsers.action',

        reader: new Ext.data.JsonReader({totalProperty: 'totalProperty',root: 'root'},User),
        listeners: {
            'update': function(thiz, record, operation){            //捕捉记录发生更改的事件
                var user = thiz.getAt(thiz.indexOf(record)).data;   //获得当前修改后的记录
                if(operation == Ext.data.Record.EDIT){              //判断update时间的操作类型是否为 edit 该事件还有其他操作类型比如 commit,reject
                    Ext.Ajax.request({
                        url: 'updateUser.action',                   //修改用户数据
                        params: {                                   //获取修改后的用户数据传到服务器
                            'user.userid': user.userid,             
                            'user.password': user.password,
                            'user.manager': user.manager,
                            'user.name': user.name,
                            'user.address': user.address,
                            'user.zip': user.zip,
                            'user.company': user.company
                        },
                        success: function(response, opts) {
                            thiz.commitChanges();                   //如果请求成功则更新本地记录:)
                        },
                        failure: function(response, opts) {
                            Ext.Msg.alert('错误','server-side failure with status code ' + response.status);
                            thiz.rejectChanges();                   //请求失败,回滚本地记录:)
                        }
                    });
                }
            },
            'remove': function(thiz,record,index){
                Ext.Ajax.request({                                  //捕捉记录删除事件
                    url: 'deleteUser.action',           
                    params: { 'user.userid': record.data.userid },  //传递被删除记录的id到服务器
                    failure: function(response, opts) {
                        Ext.Msg.alert('错误','server-side failure with status code ' + response.status);
                        store.insert(0,record)                      //如果服务器删除失败,本地插回回来的记录:)
                    }
                });
            }
        }
    });

[/code]

啥叫"动态跟新数据"

你只要监听 store的updae事件就可以了.在实践中判断是否是记录修改的操作Ext.data.Record.EDIT,然后发送ajax请求到后台即可