在卡片布局更改活动项目。 ExtJS的 [英] change active item in a card layout. ExtJS

查看:216
本文介绍了在卡片布局更改活动项目。 ExtJS的的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我必须使用卡片布局面板如下:

I have a panel using the card layout as follows:

var cardpanel = new Ext.Panel(
{
    id: 'cardPanel',
    //title: 'Card Layout',
    region: 'center',
    layout: 'card',
    activeItem: 0,
    autoDestroy: false,
    bodyStyle: 'border-top:0px',
    defaults: {
        border: false
    },
    items: [mediaGrid, mappanel],
    tbar: [
        {
            id: 'card-media',
            text: 'Media',
            icon: '/img/silk/images.png',
            width: 50,
            handler: function () {
                //switch to media
            }
        },
        {
            id: 'card-map',
            text: 'Map',
            icon: '/img/silk/map.png',
            width: 50,
            handler: function () {
                //switch to map
            }
        }
    ]
});

注释的部分在哪里我想实现在卡片布局2面板之间的切换,但林不知道该怎么做。我已经使用setActiveItem尝试,但我总是要么得到setActiveItem不是函数或者它只是没有说什么。我如何得到它的开关面板?

The commented parts are where i would like to implement the switch between the 2 panels in the card layout but im not sure how to do that. I've tried using setActiveItem but I was always either getting the setActiveItem is not a function or it it just didnt say anything. How do i get it to switch panels?

推荐答案

您需要调用

this.layout.setActiveItem();

在处理程序,并添加

scope:this

处理器定义下的。

under the handler definition.

这篇关于在卡片布局更改活动项目。 ExtJS的的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆