PDA

View Full Version : [CLOSED][3.??] GridView& RowExpander



XASD
26 Apr 2009, 10:03 AM
GridView ignore content of ".x-grid3-row-body",overwriting it blindly with row template.If row body contains some Component then we have memory leak.

Thanks.

evant
26 Apr 2009, 6:50 PM
Why is this a bug exactly?

mystix
26 Apr 2009, 6:53 PM
i concur with @evant. this isn't a bug at all.

stuffing Components into a GridView is a custom design decision -- it's the responsiblity of the developer to destroy Components in gridrows before the gridrow template is overwritten with new content.

the gridrow has absolutely no knowledge that Components are present, and it rightfully doesn't need to know.

XASD
26 Apr 2009, 10:33 PM
There's no any event defined on gridview,that provide any clue about action to be performed-rowexpander not have a chance for cleanup,before row template will be applied.

Regards.

evant
26 Apr 2009, 10:44 PM
Right, but you're putting custom behaviours in. This is fine, but it doesn't mean it's a bug with the framework. If you need this kind of functionality you'll need to put it into your own application.

Condor
26 Apr 2009, 10:50 PM
There are beforerowremoved, beforerowsinserted and beforerefresh events, so there is something to be said for a beforerowupdated event, e.g.

Ext.override(Ext.grid.GridView, {
refreshRow : function(record){
this.fireEvent("beforerowupdated", this, index, record);
var ds = this.ds, index;
if(typeof record == 'number'){
index = record;
record = ds.getAt(index);
}else{
index = ds.indexOf(record);
}
var cls = [];
this.insertRows(ds, index, index, true);
this.getRow(index).rowIndex = index;
this.onRemove(ds, record, index+1, true);
this.fireEvent("rowupdated", this, index, record);
}
});

mystix
26 Apr 2009, 11:07 PM
There are beforerowremoved, beforerowsinserted and beforerefresh events, so there is something to be said for a beforerowupdated event, e.g.


+1

might be better to post this in the Feature Requests forum though.

XASD
26 Apr 2009, 11:45 PM
Entirely agree,Condor:) I know that I need to do cleanup myself,but without help of framework-think proper hooks infrastructure for tracing framework actions(particularly destructive),I can't.

Thanks.