5 'Ext.layout.container.Border'
8 Ext.onReady(function(){
10 extend: 'Ext.data.Model',
12 // set up the fields mapping into the xml doc
13 // The first needs mapping, the others are very basic
14 {name: 'Author', mapping: 'ItemAttributes > Author'},
22 // create the Data Store
23 var store = Ext.create('Ext.data.Store', {
29 // the return will be XML, so lets set up a reader
33 totalProperty : 'total'
39 var grid = Ext.create('Ext.grid.Panel', {
42 {text: "Author", width: 120, dataIndex: 'Author', sortable: true},
43 {text: "Title", flex: 1, dataIndex: 'Title', sortable: true},
44 {text: "Manufacturer", width: 115, dataIndex: 'Manufacturer', sortable: true},
45 {text: "Product Group", width: 100, dataIndex: 'ProductGroup', sortable: true}
55 // define a template to use for the detail view
57 'Title: <a href="{DetailPageURL}" target="_blank">{Title}</a><br/>',
58 'Author: {Author}<br/>',
59 'Manufacturer: {Manufacturer}<br/>',
60 'Product Group: {ProductGroup}<br/>'
62 var bookTpl = Ext.create('Ext.Template', bookTplMarkup);
64 Ext.create('Ext.Panel', {
65 renderTo: 'binding-example',
76 bodyStyle: "background: #ffffff;",
77 html: 'Please select a book to see additional details.'
81 // update panel body on selection change
82 grid.getSelectionModel().on('selectionchange', function(sm, selectedRecord) {
83 if (selectedRecord.length) {
84 var detailPanel = Ext.getCmp('detailPanel');
85 bookTpl.overwrite(detailPanel.body, selectedRecord[0].data);