简体   繁体   English

选项卡式工具栏内的 Sencha Touch List 组件

[英]Sencha Touch List Component Inside Tabbed Toolbar

I am working with the Sencha touch framework and there list item component.我正在使用 Sencha 触摸框架和列表项组件。 I have only been working with this for about 2 weeks now and I can not figure out how to get the "onItemDisclosure" to open up the "detailPanel".我现在只使用了大约 2 周,我不知道如何让“onItemDisclosure”打开“detailPanel”。 I am trying to follow this example: http://vimeo.com/19245335 .我正在尝试遵循以下示例: http://vimeo.com/19245335 I have pasted my code below.我在下面粘贴了我的代码。 Any help is very much appreciated.很感谢任何形式的帮助。

    GoW3Guide.views.detailPanel = Ext.extend(Ext.Panel, {
        id: 'detailpanel',
        tpl: 'Hello, {firstName}!',
        dockedItems: [
            {
                xtype: 'toolbar',
                items: [{
                    text: 'back',
                    ui: 'back',
                    handler: function() {
                        GoW3Guide.Viewport.setActiveItem('disclosurelist', {type:'slide', direction:'right'});
                    }
                }]
            }
        ]
    });

    Ext.reg('detailPanel', GoW3Guide.views.detailPanel);


    GoW3Guide.views.listPanel = Ext.extend(Ext.List, {
        id: 'disclosurelist',
        store: GoW3Guide.ListStore,
        itemTpl: '<div class="contact">{firstName} {lastName}</div>',
        grouped: true,
        onItemDisclosure: function(record, btn, index) {
            GoW3Guide.views.detailPanel.update(record.data);
            GoW3Guide.views.Guidescard.setActiveItem('detailpanel');
        }
    });

    Ext.reg('listPanel', GoW3Guide.views.listPanel);



    GoW3Guide.views.Guidescard = Ext.extend(Ext.Panel, {
        fullscreen: true,
        layout: 'card',
        cardSwitchAnimation: 'slide',
        initComponent: function() {
            Ext.apply(this, {
                items: [GoW3Guide.views.listPanel, GoW3Guide.views.detailPanel]
            });
            GoW3Guide.views.Guidescard.superclass.initComponent.apply(this, arguments);
        }
    });
    Ext.reg('guidescard', GoW3Guide.views.Guidescard);

Are you getting any javascript errors?您是否收到任何 javascript 错误?

According to the docs setActiveItem either needs a component instance, a number (card index), or a config object, eg {xtype:'detailPanel'}根据文档 setActiveItem 要么需要一个组件实例、一个数字(卡片索引),要么需要一个配置 object,例如 {xtype:'detailPanel'}

If you want to make a new detail panel active try如果您想激活新的详细信息面板,请尝试

GoW3Guide.views.Guidescard.setActiveItem({xtype:'detailpanel'});

or或者

GoW3Guide.views.Guidescard.setActiveItem(new GoW3Guide.views.detailPanel());

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM