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', {
59 grid.getView().refresh();
63 var showSummary = true;
64 var grid = Ext.create('Ext.grid.Panel', {
68 title: 'Sponsored Projects',
70 renderTo: document.body,
72 plugins: [cellEditing],
77 tooltip: 'Toggle the visibility of the summary row',
78 text: 'Toggle Summary',
80 var view = grid.getView();
81 showSummary = !showSummary;
82 view.getFeature('group').toggleSummaryRow(showSummary);
89 ftype: 'groupingsummary',
90 groupHeaderTpl: '{name}',
91 hideGroupedHeader: true
98 dataIndex: 'description',
100 summaryType: 'count',
101 renderer: function(v, params) {
102 params.tdCls = "task";
105 summaryRenderer: function(v, params, data) {
106 return ((v === 0 || v > 1) ? '(' + v + ' Tasks)' : '(1 Task)');
119 renderer: Ext.util.Format.dateRenderer('m/d/Y'),
127 dataIndex: 'estimate',
129 renderer: function(v){
139 renderer: Ext.util.Format.usMoney,
141 summaryType: 'average',
151 renderer: function(v, params, record){
152 return Ext.util.Format.usMoney(record.get('estimate') * record.get('rate'));
155 summaryType: function(records){
157 length = records.length,
161 for (; i < length; ++i) {
163 total += record.get('estimate') * record.get('rate');
167 summaryRenderer: Ext.util.Format.usMoney