1. #1
    Ext User srajakaruna's Avatar
    Join Date
    Apr 2008
    Location
    Sri Lanka
    Posts
    161
    Vote Rating
    0
    srajakaruna is on a distinguished road

      0  

    Default Accordion - Dynamically expand/collapse ?

    Accordion - Dynamically expand/collapse ?


    I have 3 items in my Accordion. I want to expand / collapse those items dynamically.

    Ex: When I load a screen the Accordion item related to that screen should be expanded. Not the 1st item

    Is this possible ?
    Manager - Technology
    eMarketingeye Private Limited
    http://www.emarketingeye.com/

  2. #2
    Sencha - Community Support Team mystix's Avatar
    Join Date
    Mar 2007
    Location
    Singapore
    Posts
    6,236
    Vote Rating
    5
    mystix will become famous soon enough

      0  

  3. #3
    Ext User srajakaruna's Avatar
    Join Date
    Apr 2008
    Location
    Sri Lanka
    Posts
    161
    Vote Rating
    0
    srajakaruna is on a distinguished road

      0  

    Default activeItem returns error ?

    activeItem returns error ?


    Code:
    var accordion = new Ext.Panel({
    	title: 'Accordion Layout',
    	layout:'accordion',
    	width:200,
    	renderTo:'acc',
    	defaults: {
    		// applied to each contained panel
    		bodyStyle: 'padding:15px'
    	},
    	layoutConfig: {
    		// layout-specific configs go here
    		titleCollapse: false,
    		animate: true,
    		activeOnTop: true
    	},
    	items: [{
    		title: 'Panel 1',
    		html: '<p>Panel content!</p>'
    	},{
    		title: 'Panel 2',
    		html: '<p>Panel content!</p>'
    	},{
    		title: 'Panel 3',
    		html: '<p>Panel content!</p>'
    	}],
    	activeItem: 1
    });
    When you set activeItem it gives following error.

    Code:
    this.layout.setActiveItem is not a function
    http://localhost/.../ext-2.1/ext-all-debug.js
    Line 13853
    Manager - Technology
    eMarketingeye Private Limited
    http://www.emarketingeye.com/

  4. #4
    Sencha - Community Support Team mystix's Avatar
    Join Date
    Mar 2007
    Location
    Singapore
    Posts
    6,236
    Vote Rating
    5
    mystix will become famous soon enough

      0  

    Default


    wow... looks like an inconsistency / bug.
    activeItem is a property for the Accordion layout (as opposed to a config option for CardLayout / ), and is an Ext.Component (as opposed to a component-id / index for the CardLayout).

    for now, use this workaround:
    Code:
    //........
            defaults: {
                // applied to each contained panel
                bodyStyle: 'padding:15px',
                collapsed: true
            },
            items: [{
                title: 'Panel 1',
                html: '<p>Panel content!</p>'
            },{
                collapsed: false, // set this on whichever panel you want expanded initially
                title: 'Panel 2',
                html: '<p>Panel content!</p>'
            },{
                title: 'Panel 3',
                html: '<p>Panel content!</p>'
            }]
    //........
    you might want to report this in the 2.x Bugs forum too (make sure to link back to this thread / [quote][/quote] the appropriate portions).
    Last edited by mystix; 1 Aug 2008 at 12:34 AM. Reason: edit

Thread Participants: 1

Turkiyenin en sevilen filmlerinin yer aldigi xnxx internet sitemiz olan ve porn sex tarzi bir site olan mobil porno izle sitemiz gercekten dillere destan bir durumda herkesin sevdigi bir site olarak tarihe gececege benziyor. Sitenin en belirgin ozelliklerinden birisi de Turkiyede gercekten kaliteli ve muntazam, duzenli porno izle siteleri olmamasidir. Bu yuzden iste. Ayrica en net goruntu kalitesine sahip adresinde yayinlanmaktadir. Mesela diğer sitelerimizden bahsedecek olursak, en iyi hd porno video arşivine sahip bir siteyiz. "The Best anal porn videos and slut anus, big asses movies set..." hd porno faketaxi