0
votes

I'm using the rowEditing on my grid in my mvc application. I'm able to handle the event when the user clicks update. However i'm having issues get the selected record. The below behaves strangely. I do not get the record.data.Name value the first time i click update. Tho i can see the value in fire bug. enter image description here

init: function () {

        this.control({
         'button[text=Update]': {
            click: this.onMaterialUpdate
        }
  });

},

onLaunch: function () {

},
onMaterialUpdate: function (button) {

    var grid = Ext.getCmp('materialsContainer');
    var record= grid.getSelectionModel().getSelection()[0];


    if (record != null) {
        console.log(record.data.Name);
    }
}
2

2 Answers

0
votes

Not sure about it... but I think the click event happens before completeEdit, thus the record is neither committed, nor updated in the grid (or its selection).

Perhaps try to capture the edit event of the row editor instead of click? You should get the correct record there?

0
votes

I'd suggested handle edit event of the RowEditor plugin. You could subscribe to this event on grid render event for example. By getting the plugin by pluginId.