]> git.proxmox.com Git - extjs.git/blame - extjs/examples/kitchensink/classic/samples/view/panel/HeaderPosition.js
add extjs 6.0.1 sources
[extjs.git] / extjs / examples / kitchensink / classic / samples / view / panel / HeaderPosition.js
CommitLineData
6527f429
DM
1/**\r
2 * Panel headers can be docked to any side of the panel. This example demonstrates how\r
3 * to dynamically change the position of a panel header by binding the headerPosition\r
4 * config to the value of a segmented button.\r
5 */\r
6Ext.define('KitchenSink.view.panel.HeaderPosition', {\r
7 extend: 'Ext.panel.Panel',\r
8 xtype: 'panel-header-position',\r
9\r
10 //<example>\r
11 exampleTitle: 'Panel Header Positioning',\r
12 profiles: {\r
13 classic: {\r
14 icon: 'classic/resources/images/icons/fam/user.gif',\r
15 panelMargin: '10 5 10 10',\r
16 framedPanelMargin: '10 10 10 5'\r
17 },\r
18 neptune: {\r
19 glyph: 117,\r
20 bodyStyle: 'background: transparent',\r
21 panelMargin: '10 5 0 0',\r
22 framedPanelMargin: '10 0 0 5'\r
23 }\r
24 },\r
25 //</example>\r
26\r
27 width: 600,\r
28 layout: 'column',\r
29 viewModel: true,\r
30\r
31 defaults: {\r
32 bodyPadding: 10,\r
33 height: 300,\r
34 scrollable: true\r
35 },\r
36\r
37 initComponent: function() {\r
38\r
39 this.bodyStyle = this.profileInfo.bodyStyle;\r
40\r
41 this.tbar = [\r
42 {\r
43 xtype: 'label',\r
44 text: 'Header Position:'\r
45 },\r
46 {\r
47 xtype: 'segmentedbutton',\r
48 reference: 'positionBtn',\r
49 value: 'top',\r
50 defaultUI: 'default',\r
51 items: [{\r
52 text: 'Top',\r
53 value: 'top'\r
54 }, {\r
55 text: 'Right',\r
56 value: 'right'\r
57 }, {\r
58 text: 'Bottom',\r
59 value: 'bottom'\r
60 }, {\r
61 text: 'Left',\r
62 value: 'left'\r
63 }]\r
64 }\r
65 ];\r
66\r
67 this.items = [{\r
68 columnWidth: 0.5,\r
69 margin: this.profileInfo.panelMargin,\r
70 title: 'Panel',\r
71 icon: this.profileInfo.icon,\r
72 glyph: this.profileInfo.glyph,\r
73 html: KitchenSink.DummyText.longText,\r
74 bind: {\r
75 headerPosition: '{positionBtn.value}'\r
76 }\r
77 }, {\r
78 columnWidth: 0.5,\r
79 margin: this.profileInfo.framedPanelMargin,\r
80 frame: true,\r
81 title: 'Framed Panel',\r
82 icon: this.profileInfo.icon,\r
83 glyph: this.profileInfo.glyph,\r
84 html: KitchenSink.DummyText.longText,\r
85 bind: {\r
86 headerPosition: '{positionBtn.value}'\r
87 }\r
88 }];\r
89\r
90 this.callParent();\r
91 }\r
92});