NNKL.COM
welcome to my space
X
Search:  
 HOME   Add GridPanel after ViewPort already rendered
Add GridPanel after ViewPort already rendered
Published by: webmaster 2009-01-07
Welcome to:nnkl.com

  • I'm trying to add a GridPanel to a ViewPort that has already been render. My layout look like so ...

    layout = new Ext.Viewport({
    layout: 'border',
    items: [{
    id: 'centerPanel', region: 'center',
    split: true, border: false,
    layout: 'border', margins: '0 0 5 5',
    items: [{
    id: 'detailPanel', region: 'south', contentEl: 'detailView',
    initialSize: 300, height: 300, split: true,
    autoScroll: true
    }, {
    id: 'contentPanel', region: 'center', contentEl: 'contentView',
    split: true, autoScroll: true, autoHeigh: true
    }]
    }]
    });

    I'm trying to add the grid like so ...

    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?
    项目开发中遇到的extjs问题总结- 热爱漫画的女人的日志- 网易博客::
    2008年8月14日 constrain : true, 把窗口的显示位置限制在viewport中 l gridPanel 中gridView是控制grid的展现,通过viewConfig用来配置属性,其中
    http://aoqi1883.blog.163.com/blog/static/827767642008714104517997/
    HOME
    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.html
    HOME

    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?

    Yes, here is what is in that div ...






  • I Am a Sinner – What About You?
    Global Sourcing and Supplier Online by Dylan

    You are looking at:nnkl.com's Add GridPanel after ViewPort already rendered, click nnkl.com to home
  • make your christmas gift special with love letters
  • a look at the role of modern investigation services
  • financial inclusion programme launched
  • history of the ever popular game show
  • does superstition really help you win bingo
  • how to get rid of head lice
  • corporate team building
  • easy home decorating methods for the holidays
  • selecting photos of golf tournaments
  • living abundantly imagination and visualization are tools to create abundance
  • accessing the latest cycling news
  • why online bingo has become so popular
  • your allergies may be caused by mold
  •  
  • so you want to win at bingo
  • wonder of the waters a history of essential mineral baths
  • a search for ukrainian fiancee pros cons of resorting to ukrainian dating agencies
  • what causes toxic mold trouble in florida
  • how to sanitize your water in an emergency
  • 7 basics of marketing
  • must know mold precautions for the work area
  • increased cancer risks associated with working the graveyard shift
  • bingo tips for playing online bingo
  • world of warcraft gold sercrets some legal some not
  • 3 hour dieting
  • displaying your character through home decoration
  • vital information about penicillin and your new baby
  • credit cards and your happy life
  •  Homepage | Add to favorites | Contact us | Exchange links | LOGIN | Site map | 
    Copyright© 2008 nnkl.com        Site made:CFZ