PDA

View Full Version : Paging Grid Example, Resizing Problem



GDragoN
11 May 2007, 12:46 AM
Hi,

I used code for paging grid from documentation example, and I made small change considering the size of the grid. In this example, width of the control is set to 694px. I have changed this to 100%. Also, I have set the width of the grid inside this control to 100%. When page is loaded, control and grid are displayed with full width of the browser window (picture: page_1.jpg). But If I make browser windows wider, control is resized properly, but the grid inside is still the same width as it was when it was drawn first (picture: page_2.jpg). If I make window smaller, then grid is rendered outside of the control (picture: page_3.jpg).

How to correct this, and have a grid that is properly resized with the size of the control in this example?

Regards,
Milan Petrovic

jsakalos
11 May 2007, 3:10 AM
What about putting the grid into GridPanel?

GDragoN
11 May 2007, 5:17 AM
I am not sure how to do this. There are no examples of how to use GridPanel in documentation (at least I didn't find one). If I use code from 'Paging Grid Example' from documentation, what I need to add to make resizing automatic? I tried to add grid to GridPanel, but the grid is not showing. I have made following changes:

-> after grid.render(); I have added creation of GridPanel: var gPanel = new Ext.GridPanel(grid);
but I am not sure how to make this work or how to add autoresize features.

I am new to all this, and I really need some more practical help.

Regards,
Milan

jsakalos
11 May 2007, 5:30 AM
There is something in the doc and for sure here are some threads. Search for GridPanel.

The overall logic is:


Create a grid in a container as usually
Create a GridPanel passing the grid as argument
Add GridPanel to layout

GDragoN
11 May 2007, 6:52 AM
Thanx, I have solved this.

jsakalos
11 May 2007, 6:55 AM
Can you post HOW? I'm interested and I believe also others.