]>
git.proxmox.com Git - extjs.git/blob - extjs/examples/classic/grid/group-summary-grid.js
4 'Ext.form.field.Number' ,
6 'Ext.tip.QuickTipManager'
10 extend
: 'Ext.data.Model' ,
13 { name
: 'projectId' , type
: 'int' },
14 { name
: 'project' , type
: 'string' },
15 { name
: 'taskId' , type
: 'int' },
16 { name
: 'description' , type
: 'string' },
17 { name
: 'estimate' , type
: 'float' },
18 { name
: 'rate' , type
: 'float' },
19 { name
: 'cost' , type
: 'float' },
20 { name
: 'due' , type
: 'date' , dateFormat
: 'm/d/Y' }
25 { projectId
: 100 , project
: 'Ext Forms: Field Anchoring' , taskId
: 112 , description
: 'Integrate 2.0 Forms with 2.0 Layouts' , estimate
: 6 , rate
: 150 , due
: '06/24/2007' },
26 { projectId
: 100 , project
: 'Ext Forms: Field Anchoring' , taskId
: 113 , description
: 'Implement AnchorLayout' , estimate
: 4 , rate
: 150 , due
: '06/25/2007' },
27 { projectId
: 100 , project
: 'Ext Forms: Field Anchoring' , taskId
: 114 , description
: 'Add support for multiple types of anchors' , estimate
: 4 , rate
: 150 , due
: '06/27/2007' },
28 { projectId
: 100 , project
: 'Ext Forms: Field Anchoring' , taskId
: 115 , description
: 'Testing and debugging' , estimate
: 8 , rate
: 0 , due
: '06/29/2007' },
29 { projectId
: 101 , project
: 'Ext Grid: Single-level Grouping' , taskId
: 101 , description
: 'Add required rendering "hooks" to GridView' , estimate
: 6 , rate
: 100 , due
: '07/01/2007' },
30 { projectId
: 101 , project
: 'Ext Grid: Single-level Grouping' , taskId
: 102 , description
: 'Extend GridView and override rendering functions' , estimate
: 6 , rate
: 100 , due
: '07/03/2007' },
31 { projectId
: 101 , project
: 'Ext Grid: Single-level Grouping' , taskId
: 103 , description
: 'Extend Store with grouping functionality' , estimate
: 4 , rate
: 100 , due
: '07/04/2007' },
32 { projectId
: 101 , project
: 'Ext Grid: Single-level Grouping' , taskId
: 121 , description
: 'Default CSS Styling' , estimate
: 2 , rate
: 100 , due
: '07/05/2007' },
33 { projectId
: 101 , project
: 'Ext Grid: Single-level Grouping' , taskId
: 104 , description
: 'Testing and debugging' , estimate
: 6 , rate
: 100 , due
: '07/06/2007' },
34 { projectId
: 102 , project
: 'Ext Grid: Summary Rows' , taskId
: 105 , description
: 'Ext Grid plugin integration' , estimate
: 4 , rate
: 125 , due
: '07/01/2007' },
35 { projectId
: 102 , project
: 'Ext Grid: Summary Rows' , taskId
: 106 , description
: 'Summary creation during rendering phase' , estimate
: 4 , rate
: 125 , due
: '07/02/2007' },
36 { projectId
: 102 , project
: 'Ext Grid: Summary Rows' , taskId
: 107 , description
: 'Dynamic summary updates in editor grids' , estimate
: 6 , rate
: 125 , due
: '07/05/2007' },
37 { projectId
: 102 , project
: 'Ext Grid: Summary Rows' , taskId
: 108 , description
: 'Remote summary integration' , estimate
: 4 , rate
: 125 , due
: '07/05/2007' },
38 { projectId
: 102 , project
: 'Ext Grid: Summary Rows' , taskId
: 109 , description
: 'Summary renderers and calculators' , estimate
: 4 , rate
: 125 , due
: '07/06/2007' },
39 { projectId
: 102 , project
: 'Ext Grid: Summary Rows' , taskId
: 110 , description
: 'Integrate summaries with GroupingView' , estimate
: 10 , rate
: 125 , due
: '07/11/2007' },
40 { projectId
: 102 , project
: 'Ext Grid: Summary Rows' , taskId
: 111 , description
: 'Testing and debugging' , estimate
: 8 , rate
: 125 , due
: '07/15/2007' }
43 Ext
. onReady ( function (){
45 Ext
. tip
. QuickTipManager
. init ();
47 var store
= Ext
. create ( 'Ext.data.Store' , {
50 sorters
: { property
: 'due' , direction
: 'ASC' },
54 var cellEditing
= Ext
. create ( 'Ext.grid.plugin.CellEditing' , {
58 var grid
= Ext
. create ( 'Ext.grid.Panel' , {
62 title
: 'Sponsored Projects' ,
64 renderTo
: document
. body
,
66 plugins
: [ cellEditing
],
71 tooltip
: 'Toggle the visibility of the summary row' ,
72 text
: 'Toggle Summary' ,
76 grid
. getView (). getFeature ( 'group' ). toggleSummaryRow ();
82 ftype
: 'groupingsummary' ,
83 groupHeaderTpl
: '{name}' ,
84 hideGroupedHeader
: true ,
85 enableGroupingMenu
: false
92 dataIndex
: 'description' ,
95 summaryRenderer : function ( value
, summaryData
, dataIndex
) {
96 return (( value
=== 0 || value
> 1 ) ? '(' + value
+ ' Tasks)' : '(1 Task)' );
109 renderer
: Ext
. util
. Format
. dateRenderer ( 'm/d/Y' ),
110 summaryRenderer
: Ext
. util
. Format
. dateRenderer ( 'm/d/Y' ),
118 dataIndex
: 'estimate' ,
120 renderer : function ( value
, metaData
, record
, rowIdx
, colIdx
, store
, view
){
121 return value
+ ' hours' ;
123 summaryRenderer : function ( value
, summaryData
, dataIndex
) {
124 return value
+ ' hours' ;
133 renderer
: Ext
. util
. Format
. usMoney
,
134 summaryRenderer
: Ext
. util
. Format
. usMoney
,
136 summaryType
: 'average' ,
146 renderer : function ( value
, metaData
, record
, rowIdx
, colIdx
, store
, view
) {
147 return Ext
. util
. Format
. usMoney ( record
. get ( 'estimate' ) * record
. get ( 'rate' ));
150 summaryType : function ( records
, values
) {
152 length
= records
. length
,
156 for (; i
< length
; ++ i
) {
158 total
+= record
. get ( 'estimate' ) * record
. get ( 'rate' );
162 summaryRenderer
: Ext
. util
. Format
. usMoney