Ext


Go Back   Ext JS Forums > Ext JS Community Forums (2.0) > Ext 2.x: User Extensions and Plugins

View Poll Results: Was this helpful?
Yes - Very Much 155 76.73%
Yes - Had to tweak it 32 15.84%
No - Maybe 7 3.47%
Not at All!!! 8 3.96%
Voters: 202. You may not vote on this poll

Reply
 
Thread Tools
  #331  
Old 11-02-2009, 07:45 AM
tripEXITo's Avatar
tripEXITo tripEXITo is offline
Ext User
 
Join Date: Nov 2009
Posts: 1
tripEXITo is on a distinguished road
Send a message via MSN to tripEXITo
Default

Thanks Guys!! Very Useful Plugin! and easy to implement.
Reply With Quote
  #332  
Old 11-06-2009, 09:42 PM
uniring's Avatar
uniring uniring is offline
Ext User
 
Join Date: Mar 2009
Posts: 36
uniring is on a distinguished road
Default

Just an improvement:

calculate : function(rs, cm) {
...
if (cf.summaryType) {
    for (var j = 0, jlen = rs.length; j < jlen; j++) {
        var r = rs[j]; // get a single Record
        if(typeof cf.summaryType == 'function') {
            data[cname] = cf.summaryType(r.get(cname), r, cname, data, j);
        } else {
	    data[cname] = Ext.ux.grid.GridSummary.Calculations[cf.summaryType](r.get(cname), r, cname, data, j);
        }
    }
}
...
}
This allows for custom calculations. Another way is to make a new config variable like cf.summaryFunc.
__________________
Project manager / coder @ xDesk ERP
Reply With Quote
  #333  
Old 11-06-2009, 11:29 PM
mystix's Avatar
mystix mystix is offline
Ext JS - Community Support Team
 
Join Date: Mar 2007
Location: Singapore
Posts: 5,637
mystix is on a distinguished road
Default

Quote:
Originally Posted by uniring View Post
Just an improvement:

calculate : function(rs, cm) {
...
if (cf.summaryType) {
    for (var j = 0, jlen = rs.length; j < jlen; j++) {
        var r = rs[j]; // get a single Record
        if(typeof cf.summaryType == 'function') {
            data[cname] = cf.summaryType(r.get(cname), r, cname, data, j);
        } else {
	    data[cname] = Ext.ux.grid.GridSummary.Calculations[cf.summaryType](r.get(cname), r, cname, data, j);
        }
    }
}
...
}
This allows for custom calculations. Another way is to make a new config variable like cf.summaryFunc.
hmmm... how's that an improvement?
you're only moving the function call out of the Ext.ux.grid.GridSummary.Calculations object
unless you're omitting that object altogether?
__________________


3.x - ( Docs | Examples | SVN Log ) / 2.x - ( Docs | Examples )
HOWTO - ( Report Bugs | Post Proper Code ) / Learn / Saki's Examples
Forum Search (FF/IE plugin) / API Search (FF/IE plugin)
Reply With Quote
  #334  
Old 11-06-2009, 11:52 PM
uniring's Avatar
uniring uniring is offline
Ext User
 
Join Date: Mar 2009
Posts: 36
uniring is on a distinguished road
Default

You're right, too many hours of coding sorry, i've just done it this way to avoid remembering the Ext.ux.grid.GridSummary.Calculations object and do it directly.
__________________
Project manager / coder @ xDesk ERP
Reply With Quote
Reply

Thread Tools

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

All times are GMT -5. The time now is 02:04 AM.

© 2006-2009 Ext, LLC
Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.