1. #1
    Ext User
    Join Date
    May 2008
    Posts
    3
    Vote Rating
    0
    john_vaudin is on a distinguished road

      0  

    Question More GridPanel in TabPanel Issues

    More GridPanel in TabPanel Issues


    I have a TabPanel which contains several tabs that have some literal html content. I use autoTabs to create the TabsPanel.All fine.

    I now create a GridPanel and render that to a pre-existing DIV within the literal content. It sort of works, but it's missing it's scrollbar, and it fails to auto-size the columns, a symptom that others have noticed.

    Looking at the other threads relating to this issue the critical thing is that I'm not adding the GridPanel to the TabPanel items. However, if I do add it then although the grid starts to works fine it gets moved to above the literal content.

    I've tried setting allowDomMove to false on the grid, but that doesn't seem to help.

    Is there a way of adding the GridPanel to the TabPanel, but still have it render in the DIV embedded within the litereal content?

  2. #2
    Sencha - Ext JS Dev Team Animal's Avatar
    Join Date
    Mar 2007
    Location
    Notts/Redwood City
    Posts
    30,506
    Vote Rating
    54
    Animal has a spectacular aura about Animal has a spectacular aura about Animal has a spectacular aura about

      0  

    Default


    DO not render.

    How do you expect the COntainer to have any awareness of what is in it if you just render? That just pours HTML into an ELement.

    This concept and what you want to do is quite clearly described here: http://extjs.com/deploy/dev/docs/?class=Ext.Container

  3. #3
    Ext User
    Join Date
    May 2008
    Posts
    3
    Vote Rating
    0
    john_vaudin is on a distinguished road

      0  

    Default


    I can understand that render() doesn't create a containership hiearchy, whilst add() does, which I guess explains why the grid isn't layed out/rendered correctly within the TabPanel - although I don't actually want the TabPanel to do any layout as such, the grid has explicit width and height set - I just want it to get it's scrollbars and suchlike.(Presumably the GridPanel relies on getting some kind of notification from the TabPanel when you select the relevant tab, which it isn't getting if it's not a child (it all works fine if the grid is on the first tab - as others have noted))

    Trouble is if I do add() the Grid to the TabPanel, then it doesn't get rendered where I want it to get rendered - i.e. in the middle of a bunch of pre-exising html. I don't want to have the add the html dynamically (and it's not entirely clear to me how I would do that anyway, since there isn't a "Literal" component as far as I can see).

    I just need to be able to attach the GridPanel to the TabPanel such that it gets whatever notification it needs to function correctly. I think.

  4. #4
    Sencha - Ext JS Dev Team Animal's Avatar
    Join Date
    Mar 2007
    Location
    Notts/Redwood City
    Posts
    30,506
    Vote Rating
    54
    Animal has a spectacular aura about Animal has a spectacular aura about Animal has a spectacular aura about

      0  

    Default


    You can't set the height and width. The height and width are managed by the TabPanel to be the correct size to be a client Panel of the TabPanel.

    What it sounds like you need is a wrapping Panel with a given layout which contains some boilerplate HTML in some child Panels, and can have a GridPanel added to it.

    Perhaps a border layout woudl accomodate your needs?

  5. #5
    Ext User
    Join Date
    May 2008
    Posts
    3
    Vote Rating
    0
    john_vaudin is on a distinguished road

      0  

    Default


    Ah - yes - that makes sense now - putting the html inside a set of panels looks is clearly the way to go.

    Thanks for your help.

Thread Participants: 1