Hybrid View

  1. #1
    Sencha - Training Team mrsunshine's Avatar
    Join Date
    Sep 2008
    Location
    Germany - Darmstadt
    Posts
    690
    Vote Rating
    12
    mrsunshine will become famous soon enough

      0  

    Question [SOLVED] headerCfg child elements does not render

    [SOLVED] headerCfg child elements does not render


    i have following problem,

    i define a headerCfg with a child element

    PHP Code:
    Ext.onReady(function() {
        
    = new Ext.Panel({
            
    title 'title',
            
    renderTo document.body,
            
    width 200,
            
    height 20,
            
    html 'content',
            
    headerCfg : {
                
    tag 'div',
                
    cls 'x-panel-header-test',
                
    cn : [{
                    
    tag 'div',
                    
    cls 'x-panel-header-status',
                    
    html 'titlechild'
                
    }]
            }
        });
    }); 
    the element with the class "x-panel-header-test" was created but not the child div with class 'x-panel-header-status'.

    Where is my error?

    Does the header rendering process remove all child elements for the tititle span and tools div?

    i am happy about any hints

    Nils
    Last edited by mrsunshine; 23 Sep 2009 at 5:09 AM. Reason: markt as solved

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

      0  

    Default


    remove the title config. It is overriding your headerCfg

  3. #3
    Sencha - Training Team mrsunshine's Avatar
    Join Date
    Sep 2008
    Location
    Germany - Darmstadt
    Posts
    690
    Vote Rating
    12
    mrsunshine will become famous soon enough

      0  

    Default


    Thank you. That does the trick, i'll only have to render the title by my own but thats no problem.

    is it possible to override the title/header after render like with setTitle() ?

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

      0  

    Default


    Probably not. That method will expect the standard header DOM structure to be there to place the text into. If you have special DOM structure, you will need a special setTitle method injected into the instance as a config.

  5. #5
    Sencha - Training Team mrsunshine's Avatar
    Join Date
    Sep 2008
    Location
    Germany - Darmstadt
    Posts
    690
    Vote Rating
    12
    mrsunshine will become famous soon enough

      0  

    Default


    okay thank you, thats what i had expected.

  6. #6
    Sencha - Training Team mrsunshine's Avatar
    Join Date
    Sep 2008
    Location
    Germany - Darmstadt
    Posts
    690
    Vote Rating
    12
    mrsunshine will become famous soon enough

      0  

    Default


    works like a charm :-)

    for those how have a similar issue, here a little example snippet

    PHP Code:
    test Ext.extend(Ext.Panel,{
        
    labelTitle:            'my title',
        
    layout:             'border',
        
    split:                 true,
        
    height:                600,
        
    collapsible:         true,
        
    headerCfg: {
            
    tag'div',
            
    cls'x-panel-header',  // Default class not applied if Custom element specified
            
    cn: [
                {
                    
    tag'div',
                    
    cls'x-panel-header-title'
                
    },
                {
                    
    tag'div',
                    
    cls'x-panel-header-icon1'
                
    },
                {
                    
    tag'div',
                    
    cls'x-panel-header-icon2'
                
    },
                {
                    
    tag'div',
                    
    cls'x-panel-header-nr'
                
    }
            ]
        },

    ...

        
    /**
         * On Render
         * @param {Object} ct
         * @param {Object} position
         */
        
    onRender: function(ct,position) {
            
    test.superclass.onRender.call(this,ct,position);
            
    this.setPanelTitle();
        },

        
    /**
         * Set Panel Title
         * Setzt den Titel des Panels
         */
        
    setPanelTitle: function(){
            
    this.header.child('.x-panel-header-title').update(this.labelTitle);
            
    this.header.child('.x-panel-header-icon1').addClass('query-typ-' this.stateNavi1);
            
    this.header.child('.x-panel-header-icon2').addClass('typ-' this.stateNavi2);
            
    this.header.child('.x-panel-header-nr').update(12345678);

        }

    ...
    }); 
    an other day i like extjs so much ;-)

Thread Participants: 2

film izle

hd film izle

film sitesi

takipci kazanma sitesi

takipci kazanma sitesi

güzel olan herşey

takipci alma sitesi

komik eğlenceli videolar