2 * The view which displays information about a speficied book
3 * @extends Ext.panel.Panel
5 Ext.define('Books.view.book.View', {
6 alias: 'widget.bookview',
7 extend: 'Ext.panel.Panel',
9 initComponent: function() {
39 this.callParent(arguments);
43 * Binds a record to this view
45 bind: function(record) {
46 var imgCt = Ext.getCmp('imgCt'),
47 contentCt = Ext.getCmp('contentCt');
49 var imgTpl = new Ext.XTemplate(
50 '<img src="{image}" />'
53 var contentTpl = new Ext.XTemplate(
54 '<div class="name">{name} <span>${price}</span></div>',
55 '<div class="author">By {author}</div>',
56 '<div class="detail">{detail}</div>'
59 imgTpl.overwrite(imgCt.el, record.data);
60 contentTpl.overwrite(contentCt.el, record.data);
62 //update the layout of the contentTpl
63 contentCt.setHeight('auto');