PDA

View Full Version : rowExpander + GridPanel + autoHeight true = crash navigator



klaygomes
28 Nov 2007, 5:59 AM
Hi all,

I'm using the plugin Ext.grid.RowExpander on a gridPanel, but i'm having problems... when the user click on the button - to collapse the row, after expand it, the browser crash... it happens always. I notice this only happens if gridPanel is configured with autoHeight:true, why? Is there any work around?

below the code i'm using (i assume Ext.grid.rowExpander.js was inclued):
[CODE]var gridInoperancia = function(){
var rd = {
data: function(e){
var a,b,h;
a = new Date(e);
b = new Date();
d = a.clearTime(true);
h = b.clearTime(true);

if(d.getTime() == h.getTime()){
return 'Hoje ' + a.format('g:i a');
} else{
if( h.add(Date.DAY, -1).getTime() == d.getTime() ){
return 'Ontem ' + a.format('g:i a');
} else{
return a.format('M/Y h:is a');
}
}
},
status: function(e){
if(e.toLowerCase() === 'confirmada'){
return e.fontcolor('red');
} else {
return e;
}
}
};
var expander = new Ext.grid.RowExpander({
tpl : new Ext.Template( '<p><b>Descri

tryanDLS
28 Nov 2007, 8:03 AM
What browser are you using?

klaygomes
28 Nov 2007, 9:15 AM
I'm using IE6

jtarini
14 Mar 2008, 1:34 PM
Put on the end of the functions(RowExpader.js): expandRow and collapseRow the folow line:
this.grid.getView().refresh();

Code:

expandRow : function(row){
if(typeof row == 'number'){
row = this.grid.view.getRow(row);
}
var record = this.grid.store.getAt(row.rowIndex);
var body = Ext.DomQuery.selectNode('tr:nth(2) div.x-grid3-row-body', row);
if(this.beforeExpand(record, body, row.rowIndex)){
this.state[record.id] = true;
Ext.fly(row).replaceClass('x-grid3-row-collapsed', 'x-grid3-row-expanded');
this.fireEvent('expand', this, record, body, row.rowIndex);
}
this.grid.getView().refresh();
},

collapseRow : function(row){
if(typeof row == 'number'){
row = this.grid.view.getRow(row);
}
var record = this.grid.store.getAt(row.rowIndex);
var body = Ext.fly(row).child('tr:nth(1) div.x-grid3-row-body', true);
if(this.fireEvent('beforcollapse', this, record, body, row.rowIndex) !== false){
this.state[record.id] = false;
Ext.fly(row).replaceClass('x-grid3-row-expanded', 'x-grid3-row-collapsed');
this.fireEvent('collapse', this, record, body, row.rowIndex);
}
this.grid.getView().refresh();
}

alexol
1 Apr 2008, 2:20 AM
Work! Thanks!

In IE7 was same problem.

t_andrey
1 Apr 2008, 6:46 PM
Could you post a link of the grid?

Thanks