1

我已经实现了一个包含两个网格的 EXTJS 4.0 选项卡面板。

当我第一次加载它时,这一切都运行良好。但是当我转到另一个面板(不是选项卡面板的子面板)然后在视口中重新加载选项卡面板或调整我的浏览器窗口大小时,HTML 子主客户端(我的网格)消失(并且它的 HTML 元素已从选项卡面板中删除)。

在此处输入图像描述

有人知道为什么会这样吗?

标签面板:

Ext.define('EY.view.center.home.container.Panel', {
    extend: 'Ext.tab.Panel',
    alias: 'widget.containerhome',
    id: 'containerhome',
    activeTab: 1,

    border: false,
    resizeTabs:true,

     items: [{
            title: 'Most Used clients',
            iconCls: 'tabIcon',
            xtype: 'mostUsedClients',
            id: 'mostUsedClients',
            scale: 'large'
        },{
                title: 'All Clients',
                xtype: 'homeclients',
                id: 'homeclients',
                scale: 'large'
            }
        ],
    requires: [
        'EY.view.center.home.client.Grid',
         'EY.view.center.home.client.mostUsedClients.mostUsedClients'
],


    initComponent: function () {
        Ext.apply(this, {



        })
        this.callParent(arguments);
    }
});

网格:

Ext.define('EY.view.center.home.client.Grid', {
    extend: 'Ext.grid.Panel',
    alias: 'widget.homeclients',
    id: 'homeclients',
    baseCls: 'homeclients',
    //frame:true,
    store: 'Clients', //Ext.data.StoreManager.lookup('serviceStore'),
    contextMenu: undefined,

    border: false,
    //flex: 1,
    padding: 3,
    hideHeaders: true,

    columns: [
        { header: 'CLIENTS', field: 'textfield', flex: 1 }

        ],


    features: [
        Ext.create('Ext.grid.feature.RowBody', {
            getAdditionalData: function (data, rowIndex, rec, orig) {
                var headerCt = this.view.headerCt;
                var colspan = headerCt.getColumnCount();
                return {

                    rowBody: createHtml(rec),
                    rowBodyCls: this.rowBodyCls,
                    rowBodyColspan: colspan
                };
            }
        }),
         {
             ftype: 'rowwrap'
         }
    ],



    viewConfig: {
        listeners: {
            itemclick: function (list, index, target, record, event) {
                if (event.target.id == 'grandAccess') {

                    var windowIsClosed = Ext.getCmp('ConfirmationWindow');
                    if (!windowIsClosed) {
                        var clientId = index.data.id;
                        var clientVat = index.data.rn;
                        eDocsUser.currentClientName = index.data.n;
                        eDocsUser.currentClientId = clientId;
                        eDocsUser.currentClientRegisterNummer = clientVat;

                        showGrantAccesWindow(index);
                    }
                } else {

                    if (Ext.getCmp('ConfirmationWindow')) {
                        Ext.getCmp('ConfirmationWindow').hide();
                    }
                    loadDataOfSelectedClient(index);
                }

            }
        }
    },





    initComponent: function () {


        this.callParent(arguments);

    }
});
4

1 回答 1

0

我们通过将网格更改为用于调整大小问题的数据视图来解决此问题(网格可能会给我带来很多问题)。

然后我们通过更改解决了另一个问题:

layout.setActiveItem(Ext.getCmp('containerhome'), {
                                type: 'slide',
                                direction: 'left',
                                duration: 5000
                            });

layout.setActiveItem(0);

我们(但不是我......:D)创建了一个新项目,而不是在卡片面板中调用旧项目。

于 2012-10-02T13:59:00.680 回答