PDA

View Full Version : Grid Disappearing on Panel Collapse



Adamw
2 Mar 2010, 12:27 PM
I have a grid in the Center region Panel and when I collapse the West Region the Grid disappears.

:-/ I have no idea why. Can someone please help?

My ColumnModel, Reader and Grid are all created in a function call. Here is a piece of that function:


// Create Grid Panel
var grid = new Ext.grid.GridPanel({
store: store, //the DataStore object to use (ds: is shorthand)
colModel: colModel, //gets the ColumnModel object to use (cm: is shorthand)
autoheight: true, //you must specify height or autoHeight
stripeRows: true, //Alternate Row color
forceFit: true,
autoSizeColumns: true,
selModel: new Ext.grid.RowSelectionModel({singleSelect:false}),
el: 'center-region-container',
loadMask: true
});

// Add GridPanel to mainPanel
crc = Ext.getCmp('center-region-container');
crc.removeAll();
crc.add({
item: grid,
title: title
});
crc.doLayout();

// Display the Grid
grid.render();When I first enter the function the Grid is rendered with data and the Title in the Center region is not visible. if I collapse the West Region, the grid disappears and the Title displays.

I would like to get the title to display with the grid and remain visible wether the West region is expanded or collapsed.

Any help would be appreciated.

evant
2 Mar 2010, 6:11 PM
Never call render() if you're dealing with layouts, it happens automatically.

Adamw
3 Mar 2010, 9:06 AM
Never call render() if you're dealing with layouts, it happens automaticallyIf I remove grid.render(); the Title loads in the center region but the grid does not????

:-/