1. #1
    Sencha User
    Join Date
    Jan 2011
    Posts
    18
    Vote Rating
    1
    krike is on a distinguished road

      0  

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

    Unanswered: 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 - Senior Forum Manager mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    37,525
    Vote Rating
    872
    Answers
    3564
    mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute

      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 @SenchaMitch
    Sencha Inc, Senior Forum Manager
    ________________
    Check out my GitHub, lots of nice things for Ext JS 4 and Sencha Touch 2
    https://github.com/mitchellsimoens

    Think my support is good? Get more personalized support via a support subscription. https://www.sencha.com/store/

    Need more help with your app? Hire Sencha Services services@sencha.com

    Want to learn Sencha Touch 2? Check out Sencha Touch in Action that is in print!

    When posting code, please use BBCode's CODE tags.

Thread Participants: 1

Tags for this Thread