-
9 Oct 2012 10:13 PM #1
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:
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 appreciatedCode: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' } } ] } });
-
12 Oct 2012 5:49 AM #2Sencha - Senior Forum Manager
- Join Date
- Mar 2007
- Location
- St. Louis, MO
- Posts
- 34,121
- Vote Rating
- 453
- Answers
- 3160
2 issues:
1. You are overnesting meaning you have a level of components that don't need to be there. This code:
The calendarView does not need to be a child of a panel. You could have:Code:items: [{ xtype: 'panel', 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.Code:items : calendarView
Mitchell Simoens @SenchaMitch
Sencha Inc, Senior Forum Manager
________________
http://www.JSONPLint.com - Source to lint your JSONP!
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 almost in print!
When posting code, please use BBCode's CODE tags.


Reply With Quote