SongInfo.js 994 B

12345678910111213141516171819202122232425262728293031323334353637
  1. Ext.define('Pandora.view.SongInfo', {
  2. extend: 'Ext.panel.Panel',
  3. alias: 'widget.songinfo',
  4. border: false,
  5. tpl: '<h1>About {artist}</h1><p>{description}</p>',
  6. initComponent: function() {
  7. this.dockedItems = [{
  8. xtype: 'container',
  9. layout: {
  10. type: 'hbox',
  11. align: 'middle',
  12. pack: 'end'
  13. },
  14. height: 100,
  15. items: [{
  16. xtype: 'component',
  17. width: 200,
  18. itemId: 'songdescription',
  19. tpl: '<h2>{artist}</h2><h1>{name}</h1><h2>{album}</h2>'
  20. }, {
  21. xtype: 'button',
  22. text: 'menu',
  23. action: 'song-menu'
  24. }]
  25. }];
  26. this.callParent();
  27. },
  28. update: function(record) {
  29. var data = record ? record.data : {};
  30. this.down('#songdescription').update(data);
  31. this.callParent([data]);
  32. }
  33. });