【问题标题】:grid group header child columns evaluated not correctly网格组标题子列评估不正确
【发布时间】:2014-01-26 04:51:43
【问题描述】:

我是 Extjs 4.2 的新手,当我使用 extjs 3.4 时,我使用了 groupheader 插件。现在我在网格中的列标题有问题。我写了 4 级列,但最后一级子列有问题。他们的身高评估不正确。
问题视图

Jsfiddle

+------------------------------------------------+ -------------------------------------------------- -----+ |第 1 栏 |第 2 栏 | +------------------------+-------------+ ------------------------------+------------------ ------ | col11 | col12 | col21 | col22 | +------------------------+-------------+ ------------------------------+------------------ -----+ | col111 | col112 | col121 | col122 | col211 | col212 | | | +------------------------------------------------+ ------------------------------| col221 | col222 | |问题空间 | c2111 | c2112 | c2121 | c2122| | | +------------------------------------------------+ -------+-------+_------+------+-------------+-- -----+ | | | | |存储数据 | | | | | +-------------------------------------------------- -------------------------------------------------- -----+

如果删除Column2,列将是正确的,Column1包含3个级别,Column2包含4个级别,这就是Column1呈现不正确的原因,如果可以的话请给我帮助,如何解决这个问题,我在Google上搜索了很多时间这个问题,但没有找到答案。
这是网格代码

Ext.define("ValyutaApp.view.revenue.Republic", {
    extend: "Ext.grid.Panel",
    requires: [
        "Ext.toolbar.Paging",
        "Ext.ux.grid.FiltersFeature",
        "Ext.form.field.Date",
        "Ext.grid.feature.Summary"
    ],
    alias: "widget.revenue-republic",
    store: "ValyutaApp.store.revenue.Republic",
    initComponent: function () {
        var me = this;
        me.features = me.buildFeatures();
        me.columns = me.buildColumns();
        me.dockedItems = me.buildDockedItems();
        me.callParent(arguments);
    },
    buildFeatures: function () {
        return {ftype: "summary"};
    },
    buildColumns: function () {
        return [
            {
                text: "Шундан",
                menuDisabled: true,
                columns: [
                    {
                        text: "Микрофирма ва кичик корхоналар",
                        menuDisabled: true,
                        columns: [
                            {
                                text: "Сони",
                                dataIndex: "MFMPSONI",
                                width: 80,
                                //xtype: "numbercolumn",
                                align: "right",
                                summaryType: "sum"
                            },
                            {
                                text: "Суммаси",
                                dataIndex: "MFMPSUM",
                                width: 120,
                                xtype: "numbercolumn",
                                align: "right",
                                summaryType: "sum"
                            }
                        ]

                    },
                    {
                        text: "Микрофирма ва кичик корхоналар тоифасига кирмайдиган",
                        menuDisabled: true,
                        columns: [
                            {
                                text: "Сони",
                                dataIndex: "KFSONI",
                                width: 80,
                                //xtype: "numbercolumn",
                                align: "right",
                                summaryType: "sum"
                            },
                            {
                                text: "Суммаси",
                                dataIndex: "KFSUM",
                                width: 120,
                                xtype: "numbercolumn",
                                align: "right",
                                summaryType: "sum"
                            }
                        ]
                    }
                ]
            },
            {
                text: "Шу жумладан: Имтиёзлар турлари сони ва суммаси",
                menuDisabled: true,
                columns: [
                    {
                        text: "ВМнинг 245-сонли карорига асосан",
                        menuDisabled: true,
                        columns: [
                            {
                                text: "3-а бандига мувофик",
                                menuDisabled: true,
                                columns: [
                                    {
                                        text: "Сони",
                                        dataIndex: "LG3ASONI",
                                        width: 80,
                                        //xtype: "numbercolumn",
                                        align: "right",
                                        summaryType: "sum"
                                    },
                                    {
                                        text: "Суммаси",
                                        dataIndex: "LG3ASUM",
                                        width: 120,
                                        xtype: "numbercolumn",
                                        align: "right",
                                        summaryType: "sum"
                                    }
                                ]
                            },
                            {
                                text: "3-б бандига мувофик",
                                menuDisabled: true,
                                columns: [
                                    {
                                        text: "Сони",
                                        dataIndex: "LG3BSONI",
                                        width: 80,
                                        //xtype: "numbercolumn",
                                        align: "right",
                                        summaryType: "sum"
                                    },
                                    {
                                        text: "Суммаси",
                                        dataIndex: "LG3BSUM",
                                        width: 120,
                                        xtype: "numbercolumn",
                                        align: "right",
                                        summaryType: "sum"
                                    }
                                ]
                            }
                        ]
                    },
                    {
                        text: "Берилган имтиёзлар",
                        menuDisabled: true,
                        columns: [
                            {
                                text: "Сони",
                                dataIndex: "LGHUKSONI",
                                width: 80,
                                //xtype: 'numbercolumn',
                                align: 'right',
                                summaryType: 'sum'
                            },
                            {
                                text: "Суммаси",
                                dataIndex: "LGHUSUM",
                                width: 120,
                                xtype: 'numbercolumn',
                                align: 'right',
                                summaryType: 'sum'
                            }
                        ]
                    }
                ]
            }
        ]
    },
    buildDockedItems: function () {
        return [
            {
                xtype: "toolbar",
                dock: "top",
                items: [
                    {
                        text: "Excel",
                        iconCls: "excel-icon",
                        action: "excel"
                    },
                    " Период: ",
                    {
                        xtype: "datefield",
                        name: "period",
                        width: 120
                    },
                    {
                        iconCls: "ok-icon",
                        action: "ok"
                    }
                ]
            },
            {
                xtype: "pagingtoolbar",
                dock: "bottom",
                store: this.store,
                displayInfo: true
            }
        ];
    }

});

这是窗口的代码

Ext.define("ValyutaApp.view.revenue.Area",{
    extend: "Ext.window.Window",
    alias: "widget.revenue-area",
    title: "Тушум тугрисида МАЪЛУМОТ",
    width: 700,
    height: 400,
    autoScroll: true,
    closable: true,
    closeAction: 'hide',
    maximizable: true,
    layout:'fit',
    items: [{
        xtype: 'revenue-republic'
    }]
});

【问题讨论】:

  • 您能否提供一个 jsfiddle 示例或至少是结果的屏幕截图
  • 请我加了jsfiddle

标签: extjs grid extjs4.2


【解决方案1】:

我有一个解决方法给你。前四列添加style

style: "padding-top: 6px; padding-bottom: 5px;"  

它不是很优雅,但是您可以使用它直到找出问题所在。结果如下:jsfidle

【讨论】:

  • 达林,非常感谢您的回答!你的回答很有用,希望能找到问题的核心
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 2012-02-13
  • 2018-08-01
  • 2013-01-04
  • 1970-01-01
  • 1970-01-01
  • 2020-11-24
  • 1970-01-01
相关资源
最近更新 更多