2017-06-07 62 views
0

我的數據存儲中有一些空值。我正在使用ftype彙總顯示彙總行,當它正在計算彙總(最小/最大值)時,它將空值視爲最小值/最大值。有什麼方法可以排除空值並計算摘要。我創建了網格如下Ext JS在網格中排除空值Ext.grid.feature.Summary

var grid = Ext.create('Ext.grid.Panel', { 
    width: width, 
    height: height, 
    //frame: true, 
    cls: 'gridPadding, x-panel gridPadding x-grid-with-row-lines x-panel-default-framed x-grid', 
    id: 'dashboardSearchGrid_' + DivId, 
    renderTo: DivId, 
    buffered: true, 
    store: store, 
    plugins: [ 
     Ext.create('Ext.ux.grid.plugin.GroupingPanel') 
    ], 
    features: [{ 
     ftype: 'summary', 
     dock: 'bottom' 
    }] 
}); 
+0

顯示一些演示撥弄實現它 – Tejas

回答

0

我通過修改getMin功能EXT-all.js源象下面

getMin: function(records, field) { 
var i = 1, 
    len = records.length, 
    value, min; 

if (len > 0) { 
    min = records[0].get(field); 
} 

for (; i < len; ++i) { 
    value = records[i].get(field); 
    if(value == null){ 
     continue; 
    } 
    if (value < min || min == null) { 
     min = value; 
    } 
} 
return min; 

}