Results 1 to 3 of 3

Thread: Problems with Card Layout

  1. #1
    Ext JS Premium Member
    Join Date
    Aug 2008
    Posts
    93

    Question Problems with Card Layout

    Hi,
    I'm trying to use the card layout to switch between two panels.
    The samples work very good.
    But I don't want to put all my config code etc. in the item part.
    Therefore I created a var testpanel = new Ext.Panel({.......

    I do this always with Ext JS but with touch it doesn't work.
    Am I wrong?

    Here is the code:
    PHP Code:
    Ext.setup({
        
    icon'icon.png',
        
    glossOnIconfalse,
        
    onReady: function() {

        var 
    testpanel = new Ext.Panel ({
          
    layout'fit',
          
    items: {
            
    titel'FitPanel',
            
    html'Fit Panel',
            
    borderfalse
          
    }
        });

        
    // create Main Panel
        
    var panel_gesamt = new Ext.Panel({
          
    fullscreentrue,            
          
    id:'panel_gesamt',
                
    layout'card',
                
    activeItem0,
          
    title'title area',
          
    items: [{
                    
    id'intro'
                    
    html'panel 1'
                
    }, {
            
    testpanel      /* --> here I get the error */
                
    }]        
        });
    }
    }); 
    TIA Stephan

  2. #2
    Sencha Premium User evant's Avatar
    Join Date
    Apr 2007
    Location
    Sydney, Australia
    Posts
    19,258

    Default

    It's not valid JS syntax, you're doing:

    Code:
    items: [{
    }, {testPanel}]
    It should be:
    Code:
    items: [{
    }, testPanel]
    Twitter - @evantrimboli
    Former Sencha framework engineer, available for consulting.
    As of 2017-09-22 I am not employed by Sencha, all subsequent posts are my own and do not represent Sencha in any way.

  3. #3
    Ext JS Premium Member
    Join Date
    Aug 2008
    Posts
    93

    Default

    Oh no, I'm so stupid.
    Thanks very much.
    In my ExtJS Code (where it works) I don't use the {'s :-D

    Thanks, Stephan

Similar Threads

  1. Ext.layout.SlideLayout - Sliding Card Layout (Shift Fx)
    By NeonMonk in forum Ext 2.x: User Extensions and Plugins
    Replies: 37
    Last Post: 8 Mar 2012, 12:05 PM
  2. Problems with Scroll in grid inside card layout
    By MtAiryEd in forum Ext 2.x: Help & Discussion
    Replies: 4
    Last Post: 4 Feb 2008, 5:54 PM

Posting Permissions

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