PDA

View Full Version : gridpanel collapse expand issue



pinidbest
3 Oct 2012, 2:46 AM
Hi,
I have a grid panel that when loaded is collapsed.
Later I am adding rows of models to its store and trying to expand it.
The problem is that after collapsing you cant see the grid.
Only after closing and opening it manually it shown the grid.

Any idea?

I tried dolayou, I tried grid.getView().refresh() but nothing works

scottmartin
3 Oct 2012, 5:51 PM
This seems to work as expected:



Ext.create('Ext.data.Store', {
storeId : 'simpsonsStore',
fields : ['name', 'email', 'change'],
data : {'items' : [
{ 'name' : 'Lisa', 'email' : '[email protected]', 'change' : 100 },
{ 'name' : 'Bart', 'email' : '[email protected]', 'change' : -20 },
{ 'name' : 'Homer', 'email' : '[email protected]', 'change' : 23 },
{ 'name' : 'Marge', 'email' : '[email protected]', 'change' : -11 }
]},
proxy : {
type : 'memory',
reader : {
type : 'json',
root : 'items'
}
}
});

var grid = Ext.create('Ext.grid.Panel', {
title : 'Simpsons',
store : Ext.data.StoreManager.lookup('simpsonsStore'),
collapsible: true,
collapsed : true,
columns : [
{ header : 'Name', dataIndex : 'name' },
{ header : 'Email', dataIndex : 'email', flex : 1 },
{ header : 'Change', dataIndex : 'change' }
],
height : 200,
width : 400,
renderTo : Ext.getBody()
});

grid.expand();
?

Scott.

pinidbest
3 Oct 2012, 6:55 PM
In any case I added
grid.setBodyStyle("visibility:visible");
And that fixed the problem.
I adont if it matter but my grid panel is inside an Ext.window