Sencha触摸日历,当添加更多的停靠项目时,列表消失

Sencha Touch Calendar, list disapears when adding more docked items

本文关键字:项目 停靠 列表 消失 日历 触摸 添加 Sencha      更新时间:2023-09-26

我正在尝试使用Sencha Touch日历扩展(http://www.sencha.com/forum/showthread.php?156351-Ext.ux.TouchCalendar)下面是我使用的示例:http://www.swarmonline.com/Ext.ux.TouchCalendar/examples/simple-events-list.html

问题是,当我添加一个新的停靠项目,你得到当点击一个事件不再工作的列表?或者至少我再也看不到名单了。然而,该列表的位置仍然有空间。

这是我试图改变的代码(注释代码是我试图实现的):

calendarPanel = new Ext.Panel({
                        fullscreen: true,
                        layout: 'fit',
                        items: [calendar],
                        dockedItems: [{         
                            //  dock: 'top',
                            //  xtype: 'toolbar',
                            //  title: 'Title App'
                            //}, {
                            xtype: 'toolbar',
                            dock: 'top',
                            ui: 'light',
                            items: [{
                                xtype: 'segmentedbutton',
                                allowMultiple: false,
                                items: [{
                                    text: 'Month',
                                    pressed: true,
                                    handler: function(){
                                        calendar.setMode('month');
                                    }
                                }, {
                                    text: 'Week',
                                    handler: function(){
                                        calendar.setMode('week');
                                    }
                                }]
                            }]
                            //}, {
                            //  dock: 'bottom',
                            //  xtype: 'toolbar'        
                            }, {
                            dock: 'bottom',
                            xtype: 'list',
                            height: 110,
                            itemTpl: '{event} {location}',
                            store: new Ext.data.Store({
                                model: 'Event',
                                data: []
                            })
                        }]
                    });

有谁知道如何添加dockeditems和保持列表?我的结构有什么问题吗?

您需要更新示例文件底部的'selectionchange'事件处理程序,以便在添加新停靠项后getDockedItems()调用使用正确的索引。

处理程序的第二行应该是:
var eventList = calendarPanel.getDockedItems()[3];

这应该能让你重新振作起来。

希望这对你有帮助!斯图尔特