-<html>\r
-<head>\r
- <title>The source code</title>\r
- <link href="../resources/prettify/prettify.css" type="text/css" rel="stylesheet" />\r
- <script type="text/javascript" src="../resources/prettify/prettify.js"></script>\r
-</head>\r
-<body onload="prettyPrint();">\r
+<html>
+<head>
+ <title>The source code</title>
+ <link href="../resources/prettify/prettify.css" type="text/css" rel="stylesheet" />
+ <script type="text/javascript" src="../resources/prettify/prettify.js"></script>
+</head>
+<body onload="prettyPrint();">
<pre class="prettyprint lang-js">Ext.ns('Ext.ux.grid');\r
\r
<div id="cls-Ext.ux.grid.GroupSummary"></div>/**\r
},\r
init : function(grid){\r
this.grid = grid;\r
- this.cm = grid.getColumnModel();\r
- this.view = grid.getView();\r
-\r
- var v = this.view;\r
+ var v = this.view = grid.getView();\r
v.doGroupEnd = this.doGroupEnd.createDelegate(this);\r
\r
v.afterMethod('onColumnWidthUpdated', this.doWidth, this);\r
\r
renderSummary : function(o, cs){\r
cs = cs || this.view.getColumnData();\r
- var cfg = this.cm.config;\r
-\r
- var buf = [], c, p = {}, cf, last = cs.length-1;\r
+ var cfg = this.grid.getColumnModel().config,\r
+ buf = [], c, p = {}, cf, last = cs.length-1;\r
for(var i = 0, len = cs.length; i < len; i++){\r
c = cs[i];\r
cf = cfg[i];\r
* @param {Object} cs\r
*/\r
calculate : function(rs, cs){\r
- var data = {}, r, c, cfg = this.cm.config, cf;\r
+ var data = {}, r, c, cfg = this.grid.getColumnModel().config, cf;\r
for(var j = 0, jlen = rs.length; j < jlen; j++){\r
r = rs[j];\r
for(var i = 0, len = cs.length; i < len; i++){\r
},\r
\r
refreshSummaryById : function(gid){\r
- var g = document.getElementById(gid);\r
+ var g = Ext.getDom(gid);\r
if(!g){\r
return false;\r
}\r
var rs = [];\r
- this.grid.store.each(function(r){\r
+ this.grid.getStore().each(function(r){\r
if(r._groupId == gid){\r
rs[rs.length] = r;\r
}\r
});\r
- var cs = this.view.getColumnData();\r
- var data = this.calculate(rs, cs);\r
- var markup = this.renderSummary({data: data}, cs);\r
-\r
- var existing = this.getSummaryNode(gid);\r
+ var cs = this.view.getColumnData(),\r
+ data = this.calculate(rs, cs),\r
+ markup = this.renderSummary({data: data}, cs),\r
+ existing = this.getSummaryNode(gid);\r
+ \r
if(existing){\r
g.removeChild(existing);\r
}\r
* @param {String} msg Text to use as innerHTML for the summary row.\r
*/\r
showSummaryMsg : function(groupValue, msg){\r
- var gid = this.view.getGroupId(groupValue);\r
- var node = this.getSummaryNode(gid);\r
+ var gid = this.view.getGroupId(groupValue),\r
+ node = this.getSummaryNode(gid);\r
if(node){\r
node.innerHTML = '<div class="x-grid3-summary-msg">' + msg + '</div>';\r
}\r
* @param {Object} cs\r
*/\r
calculate : function(rs, cs){\r
- var gcol = this.view.getGroupField();\r
- var gvalue = rs[0].data[gcol];\r
- var gdata = this.getSummaryData(gvalue);\r
+ var gcol = this.view.getGroupField(),\r
+ gvalue = rs[0].data[gcol],\r
+ gdata = this.getSummaryData(gvalue);\r
return gdata || Ext.ux.grid.HybridSummary.superclass.calculate.call(this, rs, cs);\r
},\r
\r
* @param {Boolean} skipRefresh (Optional) Defaults to false\r
*/\r
updateSummaryData : function(groupValue, data, skipRefresh){\r
- var json = this.grid.store.reader.jsonData;\r
+ var json = this.grid.getStore().reader.jsonData;\r
if(!json.summaryData){\r
json.summaryData = {};\r
}\r
* @return {Object} summaryData\r
*/\r
getSummaryData : function(groupValue){\r
- var json = this.grid.store.reader.jsonData;\r
+ var json = this.grid.getStore().reader.jsonData;\r
if(json && json.summaryData){\r
return json.summaryData[groupValue];\r
}\r
\r
//backwards compat\r
Ext.grid.HybridSummary = Ext.ux.grid.HybridSummary;\r
-</pre> \r
-</body>\r
+</pre>
+</body>
</html>
\ No newline at end of file