tags:

views:

446

answers:

4

Hi,

I have a Ext grid with RowEditor plugin. I have the following code to add 'afteredit' event to the roweditor object.

store.on('update',function(){
    });

    editor.on("afteredit",function(roweditor,changes,record,index){

        $.ajax({
            url: $("#web").val() + "/registration/client/address-save"
            ,type: 'post'
            ,data: record.json
            ,dataType: 'json'
            ,success: function(data){
                if(data.success == true){
                    alert("Update Successfully");
                }
            }
        });
    });

when I click a row and edit a value, sometimes the grid fires 'afteredit' event, but sometimes it doesn't.

Do I have a problem with my code above?

A: 

I am having the same issue. Can someone help?

hinata
A: 

Even I have the same issue guys.....:(....any solution??

rihala
A: 

Ext.grid.EditorGridPanel.prototype.onEditComplete = function(e, value, startValue){ alert('asd') }

nemot
A: 

I have also experienced the above same problem in my ExtJS code. After spending quite some time debugging my application, I realised that the problem was not coming from my code but from the RowEditor plugin itself.

The plugin worked by creating a reference to the record the user wanted to update, and after the user clicked the Update button it would compare the new and old values, and if any value was different it would execute an update. The problem was that sometimes the record would get it's values updated before this comparison is executed, thus resulting in the comparison not finding any different values and exit the function.

I edited the code of the RowEditor.js file so that instead of making comparisons with the actual record, I create a clone of the record and compare the new values with its values. Since it's a clone, its values never change and the problem is eliminated. The updated code can be found here:

http://www.mediafire.com/?l0h8efhvc9wb2fp

Stephen Bonnici