PDA

View Full Version : [FIXED-1356] GridView rowsinserted event order



Condor
22 Oct 2010, 12:25 AM
Minor issue, but the rowsinserted event should fire after the insert is complete, so AFTER processRows.


Ext.override(Ext.grid.GridView, {
insertRows : function(dm, firstRow, lastRow, isUpdate) {
var last = dm.getCount() - 1;
if( !isUpdate && firstRow === 0 && lastRow >= last) {
this.fireEvent('beforerowsinserted', this, firstRow, lastRow);
this.refresh();
this.fireEvent('rowsinserted', this, firstRow, lastRow);
} else {
if (!isUpdate) {
this.fireEvent('beforerowsinserted', this, firstRow, lastRow);
}
var html = this.renderRows(firstRow, lastRow),
before = this.getRow(firstRow);
if (before) {
if(firstRow === 0){
Ext.fly(this.getRow(0)).removeClass(this.firstRowCls);
}
Ext.DomHelper.insertHtml('beforeBegin', before, html);
} else {
var r = this.getRow(last - 1);
if(r){
Ext.fly(r).removeClass(this.lastRowCls);
}
Ext.DomHelper.insertHtml('beforeEnd', this.mainBody.dom, html);
}
if (!isUpdate) {
this.processRows(firstRow);
this.fireEvent('rowsinserted', this, firstRow, lastRow);
} else if (firstRow === 0 || firstRow >= last) {
Ext.fly(this.getRow(firstRow)).addClass(firstRow === 0 ? this.firstRowCls : this.lastRowCls);
}
}
this.syncFocusEl(firstRow);
}
});

meroy
11 Nov 2010, 8:06 PM
This has been fixed in SVN for 3.3.x.