var content = Ext.getCmp('contentPanel');
content.add(grid);
content.doLayout();
This adds the grid but it doesn't fill the space and will not resize when the contentPanel resizes. How do I add the grid so it will fill the parent Panel and resize with it?
thanks
I'd suggest letting Ext manage the creation and destruction of the markup itself.
I'm not sure how do to this. Do you have an example? The panel will contain just the grid. The reason I'm adding the grid later is because I'm using asp.net master page. The master page sets up the default layout. Then a specific page adds its own content to the contentPane. I'm sure I'm not going about this the best way. How would build up the layout in this sort of senerio?
Turkcell Technology Labs | Quick Start:: <ext:viewPort> tag’i ile hiç renderTo kullanmadan (otomatikman document.body’e render edilir) tüm ekranı kaplayan BorderLayout yaratmak mümkündür. http://labs.turkcellteknoloji.com.tr/magnoliaPublic/isola/documentation/quick-start.htmlHOME
thanks
Do you have existing markup in a div called contentView? Do you wish for the grid to take up the entire panel?
In order to have Ext manage the laying out of your components you will want to set a layout on your container.
If the div doesn't actually contain content such as html markup, I'd suggest letting Ext manage the creation and destruction of the markup itself.
Will contentPanel have multiple items in it or will it always be just the grid? Is there a reason as to why you have to add to the grid after the Viewport has been rendered? It seems a bit odd to render a Panel without any items.
To allow Ext to manage the creation and destruction of the markup you simply have to omit el and contentEl from the config. I have provided you a modified version of your example that will drop into any directory within the examples/ directory.
Example Layout
south! Notice here is some text/markup
Do you have existing markup in a div called contentView?