Вопрос

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

    });
Лицензировано под: CC-BY-SA с атрибуция
Не связан с StackOverflow
scroll top