Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/maven/6.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Layout 卡片布局-活动项目-sencha touch_Layout_Extjs4_Sencha Touch - Fatal编程技术网

Layout 卡片布局-活动项目-sencha touch

Layout 卡片布局-活动项目-sencha touch,layout,extjs4,sencha-touch,Layout,Extjs4,Sencha Touch,我有一个视图是在卡片布局。 卡有2个子视图 现在,我想获取activeitem。 在extjs中,我使用以下代码: activeItem = layout.getActiveItem().itemId; 但在sencha touch中,对于卡片布局,没有名为getActiveItem()的方法用于卡片布局。 我已经参考了sencha touch文档,我发现了这一点 有人知道这个的替代方案吗 var panel = Ext.create('Ext.Panel', { layout: 'card

我有一个视图是在卡片布局。 卡有2个子视图

现在,我想获取activeitem。 在extjs中,我使用以下代码:

 activeItem = layout.getActiveItem().itemId;
但在sencha touch中,对于卡片布局,没有名为getActiveItem()的方法用于卡片布局。 我已经参考了sencha touch文档,我发现了这一点

有人知道这个的替代方案吗

var panel = Ext.create('Ext.Panel', {
layout: 'card',
items: [
    {
        html: "First Item"
    },
    {
        html: "Second Item"
    },
    {
        html: "Third Item"
    },
    {
        html: "Fourth Item"
    }
]
});

panel.setActiveItem(1);
它还可以使用getActiveItem()方法

参考面板布局设置活动项(2);