views:

57

answers:

1

how to get the updated records,i am overriding the on Ok function to save changes in form. 1.i just override the on ok function,but not able to get modified record.Ext.override(Ext.ux.grid.RecordForm , { onOK:function() {

        updateRecord1();
    }

}); function updateRecord1() {//alert('record'); var records =store.getModifiedRecords(); if(!records.length) { return; } var data = []; Ext.each(records, function(r, i) { var o = r.getChanges(); if(r.data.newRecord) { o.newRecord = true; } o[idName] = r.get(idName); data.push(o); }); var o = { url:gl_acc.php ,method:'post' ,params:{ record:record.get('id'), task:'update' } }; Ext.Ajax.request(o); } // eo function commitChanges``

A: 

var records = this.store.getModifiedRecords();

Mchl
@mchl i am overriding onok function of record form plugin by saki in extjs,i am not able to fetch the updated record.
mayuri
I took a quick look at the source, and it seems that to get the store you need to refer to it via `this.store` or `this.grid.store`. Unless you have a global variable called `store`, calling `store.getModifiedRecords();` will not do anything (except raising an exception)
Mchl
ya...when i try to alert records.length it shows zero..thats what i want to know how to get the updated record
mayuri