【问题标题】:ExtJs5 -Ext.View.View gets hidden beneath the Ext grid and only reappears after a refreshExtJs5 -Ext.View.View 隐藏在 Ext 网格下方,仅在刷新后重新出现
【发布时间】:2015-12-17 07:56:43
【问题描述】:

我有一个使用 ExtJs5 呈现的页面。它有一个标签面板,其中包含一个xtype:Container,

 this.tabPanel = Ext.create('Ext.tab.Panel', {
        cls: 'tabPanel',
        width: '100%',
        minHeight: 400,
        activeTab: 0,
        items: [
            {
                title: 'Details',
                items: [
                    this.detailsPanel
                ]
            },
            {
                title: 'History',
                items: [
                    {
                        xtype: 'container',
                        layout: {
                            type: 'vbox',
                            align: 'stretch'
                        },
                        items: [
                            this.collectionHistoryTitle,
                            collectionHistoryChart,
                            this.horizontalLineTop,
                            this.collectionHistoryPanelView,

                            this.horizontalLineBottomMargin,
                            this.collectionHistoryGrid,
                            //this.collectionLogPaging,
                        ]
                    },
                    this.collectionHistoryDoNotChangeMessage
                ]

这里,this.collectionHistoryPanelView,如下,

this.collectionHistoryPanelView = Ext.create('Ext.view.View', {
        store: 'collectionHistoryPanelStore',
        tpl: this.collectionHistoryPanelTpl,
        emptyText: 'Please select a row.',
        loadMask: false,
        margin: '0 0 10 0'

    });

发生的情况是,当我单击网格行(this.collectionHistoryGrid)时,emptyText('请选择一行')被 html 模板(this.collectionHistoryPanelTpl)替换,隐藏在网格后面并正确显示刷新后。我已经尝试了很多东西,但到目前为止没有任何效果。

点击网格后,Ext 视图被隐藏:

刷新后工作:

【问题讨论】:

  • 您的示例缺少某些required properties。
  • 您能详细说明一下吗?我是堆栈溢出的新手。
  • 您的代码无法重现该问题,因为无法查看您在网格中引用的商店与数据视图之间的连接,以及在特定情况下如何填充数据视图记录在网格中被选中。
  • 你在collectionHistoryPanelView上试过doLayout吗?
  • 我在collectionHistoryPanelView中添加了一个监听器,它调用了面板的doLayout,但还是不行——监听器:{ beforerender:function(){ Ext.getCmp('panel').doLayout(); } }

标签: javascript extjs extjs4 extjs4.2 extjs5


【解决方案1】:

@ardabeyazoglu 的评论给出了继续前进的正确道路。我们将 Ext 视图更改为容器,并将 html 模板作为 itemTpl,一切正常。

  this.collectionHistoryPanelView = Ext.create('Ext.container.Container', {

        margin: '0 0 10 0',
        items : [
                 {
                    xtype: 'dataview',
                    itemTpl: this.collectionHistoryPanelTpl,
                    store: 'collectionHistoryPanelStore',
                 }
                ],

    });

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2020-07-13
    • 1970-01-01
    • 2017-09-15
    • 1970-01-01
    • 1970-01-01
    • 2014-10-18
    • 1970-01-01
    相关资源
    最近更新 更多