X-Git-Url: http://git.ithinksw.org/extjs.git/blobdiff_plain/d41dc04ad17d1d9125fb2cf72db2b4782dbe3a8c..b37ceabb82336ee82757cd32efe353cfab8ec267:/examples/grid/xml-grid.js diff --git a/examples/grid/xml-grid.js b/examples/grid/xml-grid.js index 103287e3..f3b7ed70 100644 --- a/examples/grid/xml-grid.js +++ b/examples/grid/xml-grid.js @@ -1,45 +1,43 @@ -/* - * Ext JS Library 2.2.1 - * Copyright(c) 2006-2009, Ext JS, LLC. - * licensing@extjs.com - * - * http://extjs.com/license - */ - -Ext.onReady(function(){ - - // create the Data Store - var store = new Ext.data.Store({ - // load using HTTP - url: 'sheldon.xml', - - // the return will be XML, so lets set up a reader - reader: new Ext.data.XmlReader({ - // records will have an "Item" tag - record: 'Item', - id: 'ASIN', - totalRecords: '@total' - }, [ - // set up the fields mapping into the xml doc - // The first needs mapping, the others are very basic - {name: 'Author', mapping: 'ItemAttributes > Author'}, - 'Title', 'Manufacturer', 'ProductGroup' - ]) - }); - - // create the grid - var grid = new Ext.grid.GridPanel({ - store: store, - columns: [ - {header: "Author", width: 120, dataIndex: 'Author', sortable: true}, - {header: "Title", width: 180, dataIndex: 'Title', sortable: true}, - {header: "Manufacturer", width: 115, dataIndex: 'Manufacturer', sortable: true}, - {header: "Product Group", width: 100, dataIndex: 'ProductGroup', sortable: true} - ], - renderTo:'example-grid', - width:540, - height:200 - }); - - store.load(); -}); +/*! + * Ext JS Library 3.2.2 + * Copyright(c) 2006-2010 Ext JS, Inc. + * licensing@extjs.com + * http://www.extjs.com/license + */ +Ext.onReady(function(){ + + // create the Data Store + var store = new Ext.data.Store({ + // load using HTTP + url: 'sheldon.xml', + + // the return will be XML, so lets set up a reader + reader: new Ext.data.XmlReader({ + // records will have an "Item" tag + record: 'Item', + id: 'ASIN', + totalRecords: '@total' + }, [ + // set up the fields mapping into the xml doc + // The first needs mapping, the others are very basic + {name: 'Author', mapping: 'ItemAttributes > Author'}, + 'Title', 'Manufacturer', 'ProductGroup' + ]) + }); + + // create the grid + var grid = new Ext.grid.GridPanel({ + store: store, + columns: [ + {header: "Author", width: 120, dataIndex: 'Author', sortable: true}, + {header: "Title", width: 180, dataIndex: 'Title', sortable: true}, + {header: "Manufacturer", width: 115, dataIndex: 'Manufacturer', sortable: true}, + {header: "Product Group", width: 100, dataIndex: 'ProductGroup', sortable: true} + ], + renderTo:'example-grid', + width:540, + height:200 + }); + + store.load(); +});