Mar 21, 2012, 4:21 PM
Add ExtJS Dinamic Grid to Ext.Net Viewport in Center Region
I' have this viewport
How can I use all the Height Space with the grid?
Or how can I create the grid and add it directlly to the MainViewport and create it like center region?
<ext:Viewport ID="MainViewport" runat="server" Layout="BorderLayout">
<Items>
<ext:Panel ID="PanelCentral" runat="server" Region="Center" Layout="ColumnLayout">
<Content>
<div id="gridSpace"></div>
</Content>
</ext:Panel>
<ext:Panel ID="PanelMargenSuperior" runat="server" Region="North" Cls="RegionNorth" Border="false" />
<ext:Panel ID="PanelMargenInferior" runat="server" Region="South" Cls="RegionSouth" Border="false" />
<ext:Panel ID="PanelMargenIzquierda" runat="server" Region="East" Cls="RegionEast" Border="false" />
<ext:Panel ID="PanelMargenDerecha" runat="server" Region="West" Cls="RegionWest" Border="false" />
</Items>
</ext:Viewport>
And create usin ExtJS a GridPanel dinamically:// Create the grid and bind it with the data store.
grid = new Ext.grid.GridPanel({
id: 'gridPrincipal',
store: gridStore,
cm: new Ext.grid.DynamicColumnModel(gridStore),
selModel: new Ext.grid.RowSelectionModel({ singleSelect: true }),
enableColLock: true,
renderTo: 'gridSpace',
//height: '600',
//region: 'center',
layout: 'fit',
title: 'Results',
border: false,
bbar: bar,
pageSize: resultPageSize
});
// render the grid on UI
grid.render();
Then is render to DIV tag gridSpace, but the Grid don't use all height space. How can I use all the Height Space with the grid?
Or how can I create the grid and add it directlly to the MainViewport and create it like center region?