Results 1 to 2 of 2

Thread: insert() child item into a container, weird behavior of doLayout()

  1. #1
    Ext JS Premium Member
    Join Date
    Apr 2010
    Location
    Montreal, Canada
    Posts
    265
    Answers
    3

    Default insert() child item into a container, weird behavior of doLayout()

    I have a container which I add children container via the function below. The user can specify at which position the container is added (before, after currently selected container).

    PHP Code:
    addContainer: function(position){
        var 
    newContainer = {   
            
    xtype'container'
            
    height75,
            
    anchor'100%'
        
    }
        
    this.parentContainer.insert(positionnewContainer)
                       
        
    this.parentContainer.items.each(function(sectionidx){            
                
    section.html 'Added Section = '+idx            
        
    })
       
    this.parentContainer.doLayout()       

    This always work when inserting the container as last children. If I try to insert a container, between 2 existing children

    the value before the doLayout() function will be:
    Children 1 : html = Added Section = 0
    Children 2 : html = Added Section = 1
    Children 3 : html = Added Section = 2

    the value after the doLayout() :
    Children 1 : html = Added Section = 0
    Children 2 : html = Added Section = 1
    Children 3 : html = Added Section = 1

    Am I doing something wrong ? I tried not using xtype for the newContainer and still behaves the same.

  2. #2
    Sencha - Community Support Team jsakalos's Avatar
    Join Date
    Apr 2007
    Location
    Slovakia
    Posts
    27,664
    Answers
    512

    Default

    You cannot set html like that. Use section.update('Your html').
    Jozef Sakalos, aka Saki

    Education, extensions and services for developers at new http://extjs.eu
    News: Grid MultiSearch Plugin, Grid MultiSort Plugin, Configuring ViewModel Hierarchy


Similar Threads

  1. Container doLayout() and setHeight()
    By melmac in forum Ext 3.x: Help & Discussion
    Replies: 2
    Last Post: 19 Nov 2010, 7:47 AM
  2. Referencing body of a child item when extending a container
    By elishnevsky in forum Ext 3.x: Help & Discussion
    Replies: 8
    Last Post: 6 Aug 2009, 12:08 PM
  3. doLayout(false) on child components
    By dimitrij.zub in forum Ext 2.x: Help & Discussion
    Replies: 7
    Last Post: 3 Jul 2008, 2:41 AM
  4. Replies: 4
    Last Post: 21 Jun 2008, 10:12 AM
  5. Replies: 3
    Last Post: 20 Jun 2008, 6:48 AM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •