0

タブビューを含むナビゲーションビューがあり、そこに、コトネインとリストを含む hbox パネルと別のパネルを並べて追加したいと考えています。ただし、リストをパネルに追加しようとすると、何も表示されません。この ここに画像の説明を入力 ナビゲーションビューをどのように行うことができるのか疑問に思っていました

Ext.define('MyApp.view.Navigation', {
    extend: 'Ext.navigation.View',
    id: 'NavView',
    xtype: 'navigationcard',
    onBackButtonTap: function () {
        //if on forms screen and button is visible remove add form button
        var self = Ext.getCmp('NavView');
        var naviBtn = Ext.getCmp('addNewFormBtn');
        if (naviBtn != null) {
            naviBtn.hide();
        }
        self.pop();
    },
    config: {
        title: 'Schedule',
        iconCls: 'settings',
        navigationBar: {
            items: [{
                xtype: 'button',
                text: 'Add New Form',
                align: 'right',
                id: 'addNewFormBtn',
                hidden: true,
                handler: function () {

            }
            }]
        },
        //we only give it one item by default, which will be the only item in the 'stack' when it loads
        items: [
                   {
                       xtype: 'mainview'
                   }
        ]
    }
});

タブパネル

Ext.define('MyApp.view.Main', {
    extend: 'Ext.TabPanel',
    xtype: ['mainview', 'widget.mainview'],
    config: {
        title:'MyApp',
        fullscreen: true,
        tabBarPosition: 'bottom',
        defaults: {
            styleHtmlContent: true
        },
        items: [
            contain ,
            { xtype: 'settingscard' }
        ]
    }

});

Hbox とリストを含むパネル

var testData = [];
for (var i = 0; i < 40; i++)
{ testData.push({ txt: "test" }); }

var storesdasd = Ext.create('Ext.data.Store', {
    data: testData
});

var contain = Ext.create('Ext.Panel', {
    fullscreen: true,
    layout: 'hbox',
    title: 'Schedules',
    iconCls: 'time',
    items: [{
        xtype: 'list',
        itemTpl: '{txt}',
        store: storesdasd,
        flex: 1,
        height: 'auto'
    }

    , {
        html: 'message preview',
        style: 'background-color: #759E60;',
        flex: 2,
        height: '100'
    }],
    config: {
        title: 'Schedules',
        iconCls: 'time'
    }
});
4

2 に答える 2

1

これらすべての部分を別々のファイルに分ける代わりに、の起動機能に入れましたExt.application。これは機能したようですが、理由はわかりません。

于 2013-02-12T19:06:09.380 に答える
0

使用する:

layout: {
    type: 'hbox',
    align: 'stretch'
}

子アイテムの高さ構成を削除します。コンテイン パネルのフルスクリーン設定も削除します。

于 2013-02-07T21:51:55.307 に答える