-
14 Sep 2012 1:43 PM #1
MultiGrouping Grid and Summary
MultiGrouping Grid and Summary
Hi
My code MultiGrouping Grid and Summary ( ExtJs 4.0.7 or higher )
MultiGrouping
Снимок экрана 2012-09-15.jpg
MultiGroupingSummary
Снимок экрана 2012-09-15.jpg
mg.zip
Store:
...
groupers: ['field1', 'field2', 'field3', ...]
Grid:
features: [{ ftype: 'multigroupingsummarymy' }]
or
features: [{ ftype: 'multigrouping' }]
P.S. rebuild - http://www.sencha.com/forum/showthread.php?226739-MultiGrouping-and-MultiGroupingSummary
Thank you - ExTriqui
-
15 Sep 2012 12:36 PM #2
Thank you for the contribution.
Scott.
-
17 Sep 2012 12:28 AM #3
guidGenerator() is not defined in this code. Probably this function defined somewhere else.
Quick fix for this (insert in MultiGrouoping.js):
Code:// Generate unique id for group guidGenerator: function(gname){ var gid = 'x-' + gname + '-' + Ext.id(); return gid; },
-
17 Sep 2012 12:49 AM #4
Hi
Code guidGenerator()
Code:function guidGenerator() { var S4 = function() { return (((1 + Math.random()) * 0x10000) | 0).toString(16).substring(1); }; return (S4() + S4() + "-" + S4() + "-" + S4() + "-" + S4() + "-" + S4() + S4() + S4()); }
Code trimFIO()
Code:// Removes leading and ending whitespaces function trimFIO( value ) { return LTrim(RTrim(value)); } /// Removes leading whitespacesfunction LTrim( value ) { var re = /\s*((\S+\s*)*)/; return value.replace(re, "$1"); } // Removes ending whitespaces function RTrim( value ) { var re = /((\s*\S+)*)\s*/; return value.replace(re, "$1"); }
-
17 Sep 2012 1:55 AM #5
Thanks, azesm!
One more question. There is "group" parameter and it is group.id in MultiGrouping.js
How can I figure out parent of node on groupcontextmenu event?Code:group.id = guidGenerator();
Example:Code:groupcontextmenu: function(view, node, group, e, eOpts){//group - text parens.id}
When i click to INPUT I need to know parent ("mangle").Code:mangle:
FORWARDINPUTOUTPUT
-
17 Sep 2012 2:08 AM #6
Hi, icemanovich!
probably can not answer immediately, you need to experiment
group.id - I made in order to properly open subgroups, as in the original code, the map was not very nice
-
17 Sep 2012 3:18 AM #7
As quick solution I set group.id as composite field:
P.S. azesm, thanks for adaptation for 4.07!Code:guidGenerator: function(group){ var gid = ''; if (group.records.length){ if (group.records[0].data.table === group.name){ gid = group.name; } else { gid = group.records[0].data.table + '/' + group.name; } } else { gid = group.name; } return gid + '-' + Ext.id(); },
-
17 Sep 2012 4:26 AM #8
icemanovich,
Here's more to this grid would make the total amount of the line at the bottom. It would be cool at all.
-
4 Oct 2012 6:06 AM #9
Addition
Addition
Hi All!
Not much altered code and added the ability to include lines with the total amount
I have used code McavetiCode:features: [ { ftype: 'multigroupingsummarymy', totalSummary: 'fixed', // Can be: 'fixed', true, false. Default: false totalSummaryTopLine: true, // Default: true totalSummaryColumnLines: false, // Default: false startCollapsed: true, forceFit: true, groupHeaderTpl: '{name} ({rows.length})' }],
"Grouping Summary with Total Row for Ext 4.0.7"
http://www.sencha.com/forum/showthre...478#post790478
-
12 Nov 2012 1:19 AM #10
How to use multigroupingsummary
How to use multigroupingsummary
I don't know how to use multigroupingsummary, Who can give me a demo like this Снимок экрана 2012-09-15.jpg
Thanks
Email:bbbbkai@yahoo.com.cn


Reply With Quote