3 This file is part of Ext JS 4
5 Copyright (c) 2011 Sencha Inc
7 Contact: http://www.sencha.com/contact
9 GNU General Public License Usage
10 This file may be used under the terms of the GNU General Public License version 3.0 as published by the Free Software Foundation and appearing in the file LICENSE included in the packaging of this file. Please review the following information to ensure the GNU General Public License version 3.0 requirements will be met: http://www.gnu.org/copyleft/gpl.html.
12 If you are unsure which license is appropriate for your use, please contact the sales department at http://www.sencha.com/contact.
20 Ext.onReady(function(){
22 extend: 'Ext.data.Model',
25 {name: 'projectId', type: 'int'},
26 {name: 'project', type: 'string'},
27 {name: 'taskId', type: 'int'},
28 {name: 'description', type: 'string'},
29 {name: 'estimate', type: 'float'},
30 {name: 'rate', type: 'float'},
31 {name: 'cost', type: 'float'},
32 {name: 'due', type: 'date', dateFormat:'m/d/Y'}
36 var store = Ext.create('Ext.data.Store', {
41 url: 'remote-group-summary-grid.json',
47 sorters: {property: 'due', direction: 'ASC'},
51 var grid = Ext.create('Ext.grid.Panel', {
54 title: 'Sponsored Projects',
55 renderTo: Ext.getBody(),
67 toggleHandler: function(btn, pressed){
68 var view = grid.getView();
69 view.getFeature('group').toggleSummaryRow(pressed);
76 ftype: 'groupingsummary',
77 groupHeaderTpl: '{name}',
78 hideGroupedHeader: true,
79 remoteRoot: 'summaryData'
86 dataIndex: 'description',
88 summaryRenderer: function(value, summaryData, dataIndex) {
89 return ((value === 0 || value > 1) ? '(' + value + ' Tasks)' : '(1 Task)');
101 renderer: Ext.util.Format.dateRenderer('m/d/Y')
106 dataIndex: 'estimate',
107 renderer: function(value, metaData, record, rowIdx, colIdx, store, view){
108 return value + ' hours';
110 summaryRenderer: function(value, summaryData, dataIndex) {
111 return value + ' hours';
117 renderer: Ext.util.Format.usMoney,
118 summaryRenderer: Ext.util.Format.usMoney,
120 summaryType: 'average'
127 renderer: function(value, metaData, record, rowIdx, colIdx, store, view) {
128 return Ext.util.Format.usMoney(record.get('estimate') * record.get('rate'));
131 summaryRenderer: Ext.util.Format.usMoney