2 * Ext JS Library 2.2.1
\r
3 * Copyright(c) 2006-2009, Ext JS, LLC.
\r
4 * licensing@extjs.com
\r
6 * http://extjs.com/license
\r
9 Ext.onReady(function(){
\r
11 // create the Data Store
\r
12 var store = new Ext.data.Store({
\r
16 // the return will be XML, so lets set up a reader
\r
17 reader: new Ext.data.XmlReader({
\r
18 // records will have an "Item" tag
\r
21 totalRecords: '@total'
\r
23 // set up the fields mapping into the xml doc
\r
24 // The first needs mapping, the others are very basic
\r
25 {name: 'Author', mapping: 'ItemAttributes > Author'},
\r
26 'Title', 'Manufacturer', 'ProductGroup'
\r
31 var grid = new Ext.grid.GridPanel({
\r
34 {header: "Author", width: 120, dataIndex: 'Author', sortable: true},
\r
35 {header: "Title", width: 180, dataIndex: 'Title', sortable: true},
\r
36 {header: "Manufacturer", width: 115, dataIndex: 'Manufacturer', sortable: true},
\r
37 {header: "Product Group", width: 100, dataIndex: 'ProductGroup', sortable: true}
\r
39 renderTo:'example-grid',
\r