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.
15 Ext.require(['Ext.data.*', 'Ext.grid.*']);
16 Ext.onReady(function() {
17 // wrapped in closure to prevent global vars.
18 Ext.define('Restaurant', {
19 extend: 'Ext.data.Model',
20 fields: ['name', 'cuisine']
23 var Restaurants = Ext.create('Ext.data.Store', {
24 storeId: 'restaraunts',
26 sorters: ['cuisine','name'],
27 groupField: 'cuisine',
29 name: 'Cheesecake Factory',
32 name: 'University Cafe',
41 name: 'Gordon Biersch',
56 name: 'House of Bagels',
59 name: 'The Prolific Oven',
65 name: 'Buca di Beppo',
83 name: 'Bistro Maxine',
86 name: 'Three Seasons',
89 name: 'Sancho\'s Taquira',
105 cuisine: 'Vietnamese'
113 name: 'Patxi\'s Pizza',
116 name: 'Evvia Estiatorio',
117 cuisine: 'Mediterranean'
120 cuisine: 'Mediterranean'
122 name: 'Cafe Renaissance',
123 cuisine: 'Mediterranean'
126 cuisine: 'Mediterranean'
129 cuisine: 'Mediterranean'
131 name: 'Mango Caribbean Cafe',
134 name: 'Coconuts Caribbean Restaurant & Bar',
137 name: 'Rose & Crown',
141 cuisine: 'Mediterranean'
143 name: 'Mandarin Gourmet',
146 name: 'Bangkok Cuisine',
149 name: 'Darbar Indian Cuisine',
158 name: 'Hyderabad House',
164 name: 'Peet\'s Coffee',
170 name: 'Lytton Coffee Company',
177 cuisine: 'Mediterranean'
179 name: 'MacArthur Park',
182 name: 'St Michael\'s Alley',
183 cuisine: 'Californian'
206 name: 'Pizza My Heart',
209 name: 'New York Pizza',
212 name: 'California Pizza Kitchen',
221 name: 'Garden Fresh',
232 var groupingFeature = Ext.create('Ext.grid.feature.Grouping',{
233 groupHeaderTpl: 'Cuisine: {name} ({rows.length} Item{[values.rows.length > 1 ? "s" : ""]})'
236 var grid = Ext.create('Ext.grid.Panel', {
237 renderTo: Ext.getBody(),
239 iconCls: 'icon-grid',
244 title: 'Restaurants',
245 features: [groupingFeature],
256 text:'Clear Grouping',
257 iconCls: 'icon-clear-group',
258 handler : function(){
259 groupingFeature.disable();