extjs网格页脚总计...多次显示摘要

时间:2017-04-26 16:38:25

标签: extjs grid

我想在我的extjs项目中添加一个摘要页脚。出于某种原因,我在视觉上得到了一个时髦的回答...它似乎是添加了总计的单独行。在我的例子中,只有2行实际数据...但它似乎添加了3行页脚。要添加更多详细信息...当我在加载数据(应该是空白网格)之前查看网格时,我会看到两个总值为零的行。有谁知道如何解决这个问题?

使用store.load添加数据

screenshot

enter image description here

                            xtype: 'grid',
                        title: 'Portfolio Level',
                        itemId: 'performancePortfolioLevelGridID',
                        bind: {
                            store: '{myPortfolioPerformanceStore}'
                        },
                        margin: '10px 0px 10px 0px',
                        ui: 'featuredpanel-framed',
                        cls: 'custom-gridPerformance',
                        height: 600,
                        width: 975,
                        collapsible: false,
                        features: [{
                            ftype: 'summary'
                        }],
columns:[
{
                                header: 'Gross P&L - Daily',
                                dataIndex: 'dailyGrossPl',
                                renderer: function (value) {
                                    var newVal;
                                    var calc = value.toFixed(2).replace(/(\d)(?=(\d{3})+(?!\d))/g, "$1,")
                                    if (value > 0) {
                                        newVal = '<span style="color:green">' + "$" + calc + '</span>';
                                    } else if (value < 0) {
                                        newVal = '<span style="color:red">' + "$" + calc + '</span>';
                                    } else {
                                        newVal = "$" + calc;
                                    }
                                    return newVal;
                                },
                                align: 'right',
                                flex: 1,
                                summaryType: 'sum'
}

0 个答案:

没有答案
相关问题