Panel.js (2441B)
1 Ext.define("PartKeepr.Components.Part.Details.Panel", { 2 extend: 'Ext.tab.Panel', 3 4 xtype: 'PartDetails', 5 6 controller: 'PartDetailsController', 7 8 shadow: true, 9 width: Ext.os.is.Phone ? "100%" : "90%", 10 height: Ext.os.is.Phone ? "100%" : "90%", 11 centered: true, 12 modal: true, 13 closable: true, 14 15 cls: 'partDetails', 16 17 part: null, 18 19 activeTab: 0, 20 tabBar: { 21 layout: { 22 pack: 'center', 23 align: 'center' 24 }, 25 docked: 'bottom', 26 defaults: { 27 iconAlign: 'top' 28 } 29 }, 30 defaults: { 31 scrollable: true 32 }, 33 items: [{ 34 xtype: 'titlebar', 35 docked: 'top', 36 title: '', 37 items: [ 38 { 39 align: 'right', 40 text: i18n("Add Stock"), 41 ui: 'action', 42 handler: 'promptAddStock' 43 }, 44 { 45 align: 'right', 46 text: i18n("Remove Stock"), 47 ui: 'action', 48 handler: 'promptRemoveStock' 49 }, 50 { 51 iconCls: 'x-fa fa-close', 52 align: 'right', 53 handler: 'closePanel' 54 }] 55 },{ 56 title: i18n('General Info'), 57 padding: '24px', 58 items: {xtype: "PartDetailsOverview"}, 59 cls: 'card', 60 iconCls: 'x-fa fa-info-circle' 61 }, { 62 title: i18n("Part Parameters"), 63 html: '<span class="action">Not yet implemented</span>', 64 cls: 'card', 65 iconCls: 'x-fa fa-list-alt', 66 }, { 67 title: i18n("Distributors"), 68 id: 'tab3', 69 html: '<span class="action">Not yet implemented</span>', 70 cls: 'card', 71 iconCls: 'x-fa fa-truck', 72 }, { 73 title: i18n("Manufacturers"), 74 html: '<span class="action">Not yet implemented</span>', 75 cls: 'card', 76 iconCls: 'x-fa fa-building', 77 }, { 78 title: i18n("Attachments"), 79 html: '<span class="action">Not yet implemented</span>', 80 cls: 'card', 81 iconCls: 'x-fa fa-paperclip' 82 }], 83 84 setPart: function (part) { 85 this.part = part; 86 87 this.down("titlebar").setTitle(part.get("name")); 88 this.down("PartDetailsOverview").setPart(part); 89 }, 90 updatePart: function () { 91 console.log(this.part); 92 this.setPart(this.part); 93 }, 94 getPart: function () { 95 return this.part; 96 } 97 });