簡體   English   中英

使用Ext.grid.plugin.CellEditing編輯后遠程保存文件

[英]remote save onblur after edit using Ext.grid.plugin.CellEditing

我需要將請求(商店正在使用restproxy )發送到我的服務器onblur 我已經有save方法可以通過按鈕調用此方法。

這是我的cellEditing

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()發送請求是否可以?

問題在於同時調用了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();

    });

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM