PDA

View Full Version : Tree Panle Summary operations



davidmanohar
13 Jun 2014, 10:29 PM
Can any share an example of summary operations in tree panel
i Have tried this example

Ext.onReady(function () {
var data=[{'sla-228900-':'Incident - Root Cause Analysis Completion - Priority 1 and 2','children':[{'vendor-415020-':'Vendor 1','children':[{'tower-415020-':'Finance','children':[{'color-415020-':'red','denominator-415020-':31,'value-415020-':32.26,'reporting_month-415020-':'Apr-2012','leaf':true,'numerator-415020-':10}]},{'tower-415020-':'HR','children':[{'color-415020-':'red','denominator-415020-':8,'value-415020-':37.5,'reporting_month-415020-':'Apr-2012','leaf':true,'numerator-415020-':3}]}]}]},{'sla-228900-':'Incident Acknowledgement - Gold and Silver Applications Severity 1 and Severity 2','children':[{'vendor-415020-':'Vendor 1','children':[{'tower-415020-':'Capacity Model','children':[{'color-415020-':'amber','denominator-415020-':6,'value-415020-':83.33,'reporting_month-415020-':'Apr-2011','leaf':true,'numerator-415020-':5},{'color-415020-':'green','denominator-415020-':32,'value-415020-':96.88,'reporting_month-415020-':'Apr-2012','leaf':true,'numerator-415020-':31}]},{'tower-415020-':'Finance','children':[{'color-415020-':'red','denominator-415020-':32,'value-415020-':12.5,'reporting_month-415020-':'Apr-2011','leaf':true,'numerator-415020-':4},{'color-415020-':'red','denominator-415020-':32,'value-415020-':65.63,'reporting_month-415020-':'Apr-2011','leaf':true,'numerator-415020-':21},{'color-415020-':'red','denominator-415020-':155,'value-415020-':18.71,'reporting_month-415020-':'Apr-2012','leaf':true,'numerator-415020-':29},{'color-415020-':'red','denominator-415020-':155,'value-415020-':71.61,'reporting_month-415020-':'Apr-2012','leaf':true,'numerator-415020-':111}]},{'tower-415020-':'HR','children':[{'color-415020-':'green','denominator-415020-':9,'value-415020-':100,'reporting_month-415020-':'Apr-2011','leaf':true,'numerator-415020-':9},{'color-415020-':'green','denominator-415020-':46,'value-415020-':93.48,'reporting_month-415020-':'Apr-2012','leaf':true,'numerator-415020-':43}]},{'tower-415020-':'Marketing','children':[{'color-415020-':'red','denominator-415020-':14,'value-415020-':64.29,'reporting_month-415020-':'Apr-2011','leaf':true,'numerator-415020-':9},{'color-415020-':'green','denominator-415020-':36,'value-415020-':91.67,'reporting_month-415020-':'Apr-2012','leaf':true,'numerator-415020-':33}]}]},{'vendor-415020-':'Vendor 2','children':[{'tower-415020-':'Capacity Model','children':[{'color-415020-':'amber','denominator-415020-':11,'value-415020-':81.82,'reporting_month-415020-':'Apr-2011','leaf':true,'numerator-415020-':9},{'color-415020-':'green','denominator-415020-':1,'value-415020-':100,'reporting_month-415020-':'Apr-2012','leaf':true,'numerator-415020-':1}]},{'tower-415020-':'Finance','children':[{'color-415020-':'red','denominator-415020-':43,'value-415020-':23.26,'reporting_month-415020-':'Apr-2011','leaf':true,'numerator-415020-':10},{'color-415020-':'red','denominator-415020-':43,'value-415020-':62.79,'reporting_month-415020-':'Apr-2011','leaf':true,'numerator-415020-':27}]},{'tower-415020-':'HR','children':[{'color-415020-':'red','denominator-415020-':13,'value-415020-':61.54,'reporting_month-415020-':'Apr-2011','leaf':true,'numerator-415020-':8}]},{'tower-415020-':'Marketing','children':[{'color-415020-':'amber','denominator-415020-':10,'value-415020-':80,'reporting_month-415020-':'Apr-2011','leaf':true,'numerator-415020-':8},{'color-415020-':'green','denominator-415020-':4,'value-415020-':100,'reporting_month-415020-':'Apr-2012','leaf':true,'numerator-415020-':4}]}]},{'vendor-415020-':'Vendor 3','children':[{'tower-415020-':'Capacity Model','children':[{'color-415020-':'red','denominator-415020-':12,'value-415020-':58.33,'reporting_month-415020-':'Apr-2011','leaf':true,'numerator-415020-':7}]},{'tower-415020-':'Finance','children':[{'color-415020-':'red','denominator-415020-':61,'value-415020-':22.95,'reporting_month-415020-':'Apr-2011','leaf':true,'numerator-415020-':14},{'color-415020-':'red','denominator-415020-':61,'value-415020-':49.18,'reporting_month-415020-':'Apr-2011','leaf':true,'numerator-415020-':30}]},{'tower-415020-':'HR','children':[{'color-415020-':'red','denominator-415020-':12,'value-415020-':58.33,'reporting_month-415020-':'Apr-2011','leaf':true,'numerator-415020-':7}]},{'tower-415020-':'Marketing','children':[{'color-415020-':'amber','denominator-415020-':8,'value-415020-':87.5,'reporting_month-415020-':'Apr-2011','leaf':true,'numerator-415020-':7},{'color-415020-':'red','denominator-415020-':16,'value-415020-':37.5,'reporting_month-415020-':'Apr-2012','leaf':true,'numerator-415020-':6}]}]}]},{'sla-228900-':'Incident Time to Resolve - Severity 1 - 2 - 3','children':[{'vendor-415020-':'Vendor 1','children':[{'tower-415020-':'Capacity Model','children':[{'color-415020-':'red','denominator-415020-':32,'value-415020-':12.5,'reporting_month-415020-':'Apr-2012','leaf':true,'numerator-415020-':4}]},{'tower-415020-':'Finance','children':[{'color-415020-':'red','denominator-415020-':36,'value-415020-':16.67,'reporting_month-415020-':'Apr-2012','leaf':true,'numerator-415020-':6},{'color-415020-':'red','denominator-415020-':119,'value-415020-':12.61,'reporting_month-415020-':'Apr-2012','leaf':true,'numerator-415020-':15}]},{'tower-415020-':'HR','children':[{'color-415020-':'red','denominator-415020-':46,'value-415020-':6.52,'reporting_month-415020-':'Apr-2012','leaf':true,'numerator-415020-':3}]},{'tower-415020-':'Marketing','children':[{'color-415020-':'red','denominator-415020-':36,'value-415020-':11.11,'reporting_month-415020-':'Apr-2012','leaf':true,'numerator-415020-':4}]}]},{'vendor-415020-':'Vendor 2','children':[{'tower-415020-':'HR','children':[{'color-415020-':'red','denominator-415020-':13,'value-415020-':7.69,'reporting_month-415020-':'Apr-2011','leaf':true,'numerator-415020-':1}]},{'tower-415020-':'Marketing','children':[{'color-415020-':'red','denominator-415020-':4,'value-415020-':50,'reporting_month-415020-':'Apr-2012','leaf':true,'numerator-415020-':2}]}]},{'vendor-415020-':'Vendor 3','children':[{'tower-415020-':'Marketing','children':[{'color-415020-':'red','denominator-415020-':16,'value-415020-':12.5,'reporting_month-415020-':'Apr-2012','leaf':true,'numerator-415020-':2}]}]}]}];
//alert(data)

var columnModel=[{'id':'sla-228900-',"xtype":"treecolumn",'javaDataType':'java.lang.String','apiDataType':'Text','chartIndex':'SLA','width':112,'dataIndex':'sla-228900-','type':'string','header':'SLA'}, {'id':'vendor-415020-','javaDataType':'java.lang.String','apiDataType':'Text','chartIndex':'Vendor','width':112,'dataIndex':'vendor-415020-','type':'string','renderer':'renderDrillable','header':'Vendor'}, {'id':'tower-415020-','javaDataType':'java.lang.String','apiDataType':'Text','chartIndex':'Tower','width':112,'dataIndex':'tower-415020-','type':'string','renderer':'renderDrillable','header':'Tower'}, {'id':'reporting_month-415020-','javaDataType':'java.lang.String','apiDataType':'Date','chartIndex':'Reporting Month','width':112,'dataIndex':'reporting_month-415020-','type':'string','renderer':'formatReportColumn','header':'Reporting Month'}, {'id':'numerator-415020-','javaDataType':'java.lang.Double','apiDataType':'Text','chartIndex':'SLA Met Incidents','width':112,'dataIndex':'numerator-415020-','type':'numeric','renderer':'renderDrillable','header':'SLA Met Incidents'},{'id':'denominator-415020-','javaDataType':'java.lang.Double','apiDataType':'Text','chartIndex':'Total Incidents','width':112,'dataIndex':'denominator-415020-','type':'numeric','renderer':'renderDrillable','header':'Total Incidents', 'summaryType': 'average'}, {'id':'value-415020-','javaDataType':'java.lang.Double','apiDataType':'Text','chartIndex':'Achieved Performance in %','width':112,'dataIndex':'value-415020-','type':'numeric','renderer':'formatReportColumn','header':'Achieved Performance in %'}, {'id':'color-415020-','javaDataType':'java.lang.String','apiDataType':'Text','chartIndex':'Color','hidden':true,'width':112,'dataIndex':'color-415020-','type':'string','renderer':'renderDrillable','header':'Color'}];
var fields=[{'name':'sla-228900-'}, {'name':'vendor-415020-'}, {'name':'tower-415020-'}, {'name':'reporting_month-415020-'}, {'name':'numerator-415020-'}, {'name':'denominator-415020-'}, {'name':'value-415020-'}, {'name':'color-415020-'}];
Ext.create('Ext.tree.Panel', {
title: 'TreeGrid',
renderTo: Ext.getBody(),
rootVisible:false,
fields:fields,
columns: columnModel,
root: {
name: 'Root',
description: 'Root description',
expanded: true,
children: data
},
features: [{
ftype: 'summary'
}]
});
});

Gary Schlosberg
19 Jun 2014, 8:26 AM
I don't believe that there is a summary feature for tree panels, and I couldn't find any threads with a custom implementation. Hopefully someone in the community has been down this road and will share.