0

2 つの v-box が 2 つの異なるタブにあるビューが必要です。私のコードはエラーを表示しませんが、タブのないタブ付きパネルに表示される唯一のものです。同じクラスのいくつかのコピーを使用して、チュートリアルのカルーセルを部分的に編集していることがわかりますが、それは無視してください。

Ext.define("caryhartline.view.Carousel", {
    extend : 'Ext.tab.Panel',
    requires : ['Ext.carousel.Carousel'],
    config : [{
        tabBarPosition : 'top',
        items : [{
            title : 'Business',
            iconCls : 'action',
            layout : 'card',
            config : [{
                cls : 'cards',
                layout : {
                    type : 'vbox',
                    align : 'stretch'
                },
                defaults : {
                    flex : 1
                },
                items : [{
                            xtype : 'carousel',
                            items : [{
                                        html : '',
                                        cls : 'card businesstemplatepicture'
                                    }, {
                                        html : '',
                                        cls : 'card businesstemplatepicture'
                                    }]
                        }, {
                            xtype : 'carousel',
                            ui : 'light',
                            direction : 'vertical',
                            items : [{
                                        html : '',
                                        cls : 'card dark businesstemplate2picture'
                                    }, {
                                        html : 'And can also use <code>ui:light</code>.',
                                        cls : 'card dark'
                                    }, {
                                        html : 'Card #3',
                                        cls : 'card dark'
                                    }]
                        }]
            }]
        }]
    }, {
        title : 'Minimalist',
        iconCls : 'action',
        layout : 'card',
        config : {
            cls : 'cards',
            layout : {
                type : 'vbox',
                align : 'stretch'
            },
            defaults : {
                flex : 1
            },
            items : [{
                        xtype : 'carousel',
                        items : [{
                                    html : '',
                                    cls : 'card businesstemplatepicture'
                                }, {
                                    html : '',
                                    cls : 'card businesstemplatepicture'
                                }]
                    }, {
                        xtype : 'carousel',
                        ui : 'light',
                        direction : 'vertical',
                        items : [{
                                    html : '',
                                    cls : 'card dark businesstemplate2picture'
                                }, {
                                    html : 'And can also use <code>ui:light</code>.',
                                    cls : 'card dark'
                                }, {
                                    html : 'Card #3',
                                    cls : 'card dark'
                                }]
                    }]
        }
    }]
});
4

1 に答える 1

2

何らかの理由で、構成内に物を入れると問題が発生します。何が悪いのかわからない。クラス定義でネストされた構成を使用できないと思います。しかし、これはうまくいくはずです

Ext.define("App.view.Carousel", {
    extend : 'Ext.tab.Panel',
    requires : ['Ext.carousel.Carousel'],
    config : {
        tabBarPosition : 'top',
        items : [{
            title : 'Business',
            iconCls : 'action',
            cls : 'cards',
            layout : {
                type : 'vbox',
                align : 'stretch'
            },
            defaults : {
                flex : 1
            },
            items : [{
                xtype : 'carousel',
                items : [{
                    html : 'Test 1',
                    cls : 'card businesstemplatepicture'
                }, {
                    html : 'Test 2',
                    cls : 'card businesstemplatepicture'
                }]
            }, {
                xtype : 'carousel',
                ui : 'light',
                direction : 'vertical',
                items : [{
                    html : 'Test 3',
                    cls : 'card dark businesstemplate2picture'
                }, {
                    html : 'And can also use <code>ui:light</code>.',
                    cls : 'card dark'
                }, {
                    html : 'Card #3',
                    cls : 'card dark'
                }]
            }]
        }, {
            title : 'Minimalist',
            iconCls : 'action',
            xtype:'panel',            
            layout:'vbox',
            defaults:{
                flex:1
            },
            items:[{
                xtype : 'carousel',
                direction:'vertical',
                items:[
                    {
                        style:'background-color:blue;'
                    },
                    {
                        style:'background-color:red;'
                    }
                ]
            },{
                xtype : 'carousel',
                direction:'horizontal',
                items:[
                    {
                        style:'background-color:green;'
                    },
                    {
                        style:'background-color:orange;'
                    }
                ]
                }
            ]
        }]
    }
});
于 2012-08-04T02:51:13.047 に答える