Results 1 to 2 of 2

Thread: Calendar will load but won't show (layout problem?)

  1. #1
    Sencha User
    Join Date
    Jan 2011
    Posts
    18
    Vote Rating
    1
      0  

    Default Calendar will load but won't show (layout problem?)

    Hey, I have a small problem. I try to add a calendar to a panel based on the examples of the extention. It looks like it is being added because when I look at the source html code i can say the calendar table but it won't show up in the panel.

    I made a similar interface as the kitchen sink. so a nested list on the left, toolbar at the top and of course the content on the right. Here is the code:

    Code:
    var calendarView = Ext.create('Ext.ux.TouchCalendarView', {            viewMode: 'day',
                weekStart: 1,
                value: new Date()
            });
            
    Ext.define("HouseApp.view.mainView", {
        extend      : 'Ext.Container',
        // edit later, fixed width for iphone and ipad 3/4 screen
        //width: 320,
        fullscreen: true,
        layout: {
            type: 'vbox',
            align: 'stretch'
        },
        config: {
            fullscreen    : true,
            scrollable: 'vertical',
            items: [
                {       // This is the content area... 
                    id: 'launchscreen',
                    cls : 'card',
                    layout: 'fit',
                    docked: 'right',
                    //fullscreen    : true,
                    items: [{
                        xtype: 'panel',
                        items: [calendarView]
                    }]
                    
                }, { 
                    // The left navigation
                    id: 'mainNestedList',
                    xtype : 'nestedlist',
                    useTitleAsBackText: false,
                    docked: 'left',
                    width : 250,
                    store: 'NestedListOptions'
                }, {
                    // The top toolbar
                    id: 'mainNavigationBar',
                    xtype : 'titlebar',
                    docked: 'top',
                    title : 'Main container',
                    items: {
                        xtype : 'button',
                        id: 'addEvent',
                        align : 'right',
                        ui    : 'action',
                        action: 'addEvent',
                        text  : 'Add Event'
                    }
                }
            ]
        }
    });
    I guess I'm supposed to define that calendar first like i define the mainView but I wanted to make sure that at least the code above would work. I'm still a novice and any help would be appreciated

  2. #2
    Sencha User mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    40,050
    Answers
    3976
    Vote Rating
    1381
      0  

    Default

    2 issues:

    1. You are overnesting meaning you have a level of components that don't need to be there. This code:

    Code:
                    items: [{
                        xtype: 'panel',
                        items: [calendarView]
                    }]
    The calendarView does not need to be a child of a panel. You could have:

    Code:
    items : calendarView
    2. You need to specify config objects not instances so calendarView should be a config not an instance. If you create multiple instances of the HouseApp.view.mainView component then the calendarView instance will be shared or odd things will start to happen. You need to specify config objects in Ext.define when outside a method.
    Mitchell Simoens @LikelyMitch
    Modus Create, Senior Frontend Engineer
    ________________
    Need any sort of Ext JS help? Modus Create is here to help!

    Check out my GitHub:
    https://github.com/mitchellsimoens

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
  •