0

我需要将请求(商店正在使用restproxy)发送到我的服务器onblur。我已经有了从按钮调用它的保存方法。

这是我的细胞编辑

var cellEditing = Ext.create('Ext.grid.plugin.CellEditing', {
        clicksToEdit: 1,
    });

    grid.plugins = [cellEditing];
    grid.on('edit', function(editor, e) {
        // commit the changes right after editing finished
        e.record.commit();
        e.grid.store.save();

    });

我在官方文档中读到这是需要的事件,但是在我看来它在编辑之前就被触发了。

简而言之

  1. 编辑单元格后我必须绑定的事件是什么?
  2. 使用e.grid.store.save()发送请求可以吗?
4

1 回答 1

0

问题是同时调用方法commitsave.

record.commit 正在清理dirty标志,因此 store.save 找不到任何sync.

工作样本:

var cellEditing = Ext.create('Ext.grid.plugin.CellEditing', {
        clicksToEdit: 1,
    });

    grid.plugins = [cellEditing];
    grid.on('edit', function(editor, e) {
        // commit the changes right after editing finished
        e.grid.store.save();

    });
于 2012-11-08T15:38:48.657 回答