X-Git-Url: http://git.ithinksw.org/extjs.git/blobdiff_plain/6e39d509471fe9b4e2660e0d1631b350d0c66f40..2e847cf21b8ab9d15fa167b315ca5b2fa92638fc:/examples/grid/grouping.js diff --git a/examples/grid/grouping.js b/examples/grid/grouping.js index 06997733..9066934e 100644 --- a/examples/grid/grouping.js +++ b/examples/grid/grouping.js @@ -1,15 +1,16 @@ /*! - * Ext JS Library 3.1.0 - * Copyright(c) 2006-2009 Ext JS, LLC + * 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'}, @@ -21,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'}, @@ -49,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 }); });