Hi,
I have a TreeTable with the following configuration
var dtable = webix.ui({
container:divid,
view:'treetable',
id:'data',
columns:[
{ id:"Tagname",width:150, sort:"string",
template:function(obj, common){
if (obj.$group) return common.treetable(obj, common) + obj.Tagname;
return '';}},
{ id:"Dat", header:"Date", width:180, sort:"string"},
{ id:"Samples", header:"samples", width:100, sort:"int",css:{"text- align":"right"},format:webix.Number.numToStr({groupDelimiter:",",groupSize:3,decimalDelimeter:".",decimalSize:0})},
{ id:"Defects", header:"Defects", width:100, sort:"int",css:{"text-align":"right"},format:webix.Number.numToStr({groupDelimiter:",",groupSize:3,decimalDelimeter:".",decimalSize:0})},
{ id:"Dpm", header:"Dpmo", width:100, sort:"int",css:{"text-align":"right"},format:webix.Number.numToStr({groupDelimiter:",",groupSize:3,decimalDelimeter:".",decimalSize:0})}
],
autoConfig:true,
data: series,
drag:'order',
headerRowHeight: 24,
rowHeight:22,
resizeColumn:true,
'export':true,
scheme:{
$group:{
by :"Tagname",
map :{
// open:["1", "string" ],
Tagname:["Tagname"],
Samples:["Samples","sum"],
Defects:["Defects","sum"],
Dpm: [function(obj){
return obj.Defects*1000000/obj.Samples;
}]
}
}
},
height:500,
width:700
});
I need to get a value for column Dpm which is (sum of Samples)*1000000/(sum of Defects) in that group. In the above example, the value returned is the first row values of the group instead of the sum of the group column.