简体   繁体   中英

remote save onblur after edit using Ext.grid.plugin.CellEditing

I need to send the request (the store is using a restproxy ) to my server onblur . I already have the save method working calling this from a button.

This is my 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();

    });

I've read in the official doc that this is the needed event, however it seems to me that it is fired before editing.

In short

  1. What is the event that I have to bind after the cell was edited ?
  2. Is it fine to use the e.grid.store.save() to send the request ?

The problem was calling both methods commit and save .

record.commit is cleaning the dirty flag, so store.save doesn't find anything to sync .

working sample:

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();

    });

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM