开发者

ok button in record Form plugin in extjs

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


var records = this.store.getModifiedRecords();

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜