X-Git-Url: http://git.ithinksw.org/extjs.git/blobdiff_plain/d41dc04ad17d1d9125fb2cf72db2b4782dbe3a8c..2e847cf21b8ab9d15fa167b315ca5b2fa92638fc:/examples/grid/grouping.js diff --git a/examples/grid/grouping.js b/examples/grid/grouping.js index 6031b32a..9066934e 100644 --- a/examples/grid/grouping.js +++ b/examples/grid/grouping.js @@ -1,17 +1,16 @@ -/* - * Ext JS Library 2.2.1 - * Copyright(c) 2006-2009, Ext JS, LLC. - * licensing@extjs.com - * - * http://extjs.com/license - */ - +/*! + * Ext JS Library 3.1.1 + * Copyright(c) 2006-2010 Ext JS, LLC + * licensing@extjs.com + * http://www.extjs.com/license + */ Ext.onReady(function(){ Ext.QuickTips.init(); - + var xg = Ext.grid; + // shared reader var reader = new Ext.data.ArrayReader({}, [ {name: 'company'}, @@ -23,14 +22,15 @@ Ext.onReady(function(){ {name: 'desc'} ]); - var grid = new xg.GridPanel({ - store: new Ext.data.GroupingStore({ + var store = new Ext.data.GroupingStore({ reader: reader, data: xg.dummyData, sortInfo:{field: 'company', direction: "ASC"}, groupField:'industry' - }), + }); + var grid = new xg.GridPanel({ + store: store, columns: [ {id:'company',header: "Company", width: 60, sortable: true, dataIndex: 'company'}, {header: "Price", width: 20, sortable: true, renderer: Ext.util.Format.usMoney, dataIndex: 'price'}, @@ -51,6 +51,13 @@ Ext.onReady(function(){ animCollapse: false, title: 'Grouping Example', iconCls: 'icon-grid', + fbar : ['->', { + text:'Clear Grouping', + iconCls: 'icon-clear-group', + handler : function(){ + store.clearGrouping(); + } + }], renderTo: document.body }); });