]>
Commit | Line | Data |
---|---|---|
6527f429 DM |
1 | /**\r |
2 | * This example demonstrates some of the more advanced features of tabs, including:\r | |
3 | *\r | |
4 | * - Side and bottom docking\r | |
5 | * - Tab rotation\r | |
6 | * - Closable tabs\r | |
7 | * - Dynamically adding and removing tabs\r | |
8 | * - Dynamically switching the position and rotation of tab bars\r | |
9 | */\r | |
10 | Ext.define('KitchenSink.view.tab.AdvancedTabs', {\r | |
11 | extend: 'Ext.panel.Panel',\r | |
12 | xtype: 'advanced-tabs',\r | |
13 | controller: 'advanced-tabs',\r | |
14 | \r | |
15 | //<example>\r | |
16 | otherContent: [{\r | |
17 | type: 'ViewController',\r | |
18 | path: 'classic/samples/view/tab/AdvancedTabsController.js'\r | |
19 | }],\r | |
20 | exampleTitle: 'Advanced Tabs',\r | |
21 | profiles: {\r | |
22 | classic: {\r | |
23 | icon1: 'classic/resources/images/icons/fam/cog.gif',\r | |
24 | icon2: 'classic/resources/images/icons/fam/user.gif',\r | |
25 | icon3: 'classic/resources/images/icons/fam/accept.gif',\r | |
26 | iconAdd: 'classic/resources/images/icons/fam/add.gif',\r | |
27 | buttonUI: 'default',\r | |
28 | width: 580\r | |
29 | },\r | |
30 | neptune: {\r | |
31 | glyph1: 42,\r | |
32 | glyph2: 70,\r | |
33 | glyph3: 86,\r | |
34 | glyphAdd: 43,\r | |
35 | buttonUI: 'default-toolbar',\r | |
36 | width: 620\r | |
37 | },\r | |
38 | 'neptune-touch': {\r | |
39 | width: 740\r | |
40 | },\r | |
41 | triton: {\r | |
42 | width: 700\r | |
43 | }\r | |
44 | },\r | |
45 | //</example>\r | |
46 | \r | |
47 | height: 400,\r | |
48 | layout: 'fit',\r | |
49 | viewModel: true,\r | |
50 | \r | |
51 | initComponent: function() {\r | |
52 | Ext.apply(this, {\r | |
53 | width: this.profileInfo.width,\r | |
54 | tbar: [\r | |
55 | {\r | |
56 | xtype: 'label',\r | |
57 | text: 'Position:',\r | |
58 | padding: '0 0 0 5'\r | |
59 | },\r | |
60 | {\r | |
61 | xtype: 'segmentedbutton',\r | |
62 | reference: 'positionBtn',\r | |
63 | value: 'top',\r | |
64 | defaultUI: this.profileInfo.buttonUI,\r | |
65 | items: [{\r | |
66 | text: 'Top',\r | |
67 | value: 'top'\r | |
68 | }, {\r | |
69 | text: 'Right',\r | |
70 | value: 'right'\r | |
71 | }, {\r | |
72 | text: 'Bottom',\r | |
73 | value: 'bottom'\r | |
74 | }, {\r | |
75 | text: 'Left',\r | |
76 | value: 'left'\r | |
77 | }]\r | |
78 | },\r | |
79 | {\r | |
80 | xtype: 'label',\r | |
81 | text: 'Rotation:',\r | |
82 | padding: '0 0 0 5'\r | |
83 | },\r | |
84 | {\r | |
85 | xtype: 'segmentedbutton',\r | |
86 | reference: 'rotationBtn',\r | |
87 | value: 'default',\r | |
88 | defaultUI: this.profileInfo.buttonUI,\r | |
89 | items: [{\r | |
90 | text: 'Default',\r | |
91 | value: 'default'\r | |
92 | }, {\r | |
93 | text: 'None',\r | |
94 | value: 0\r | |
95 | }, {\r | |
96 | text: '90deg',\r | |
97 | value: 1\r | |
98 | }, {\r | |
99 | text: '270deg',\r | |
100 | value: 2\r | |
101 | }]\r | |
102 | },\r | |
103 | {\r | |
104 | xtype: 'button',\r | |
105 | icon: this.profileInfo.iconAdd,\r | |
106 | glyph: this.profileInfo.glyphAdd,\r | |
107 | tooltip: 'Add Tab',\r | |
108 | listeners: {\r | |
109 | click: 'onAddTabClick'\r | |
110 | }\r | |
111 | },\r | |
112 | {\r | |
113 | xtype: 'button',\r | |
114 | enableToggle: true,\r | |
115 | tooltip: 'Auto Cycle!',\r | |
116 | listeners: {\r | |
117 | toggle: 'onAutoCycleToggle'\r | |
118 | },\r | |
119 | glyph: 109\r | |
120 | }\r | |
121 | ],\r | |
122 | items: [{\r | |
123 | xtype: 'tabpanel',\r | |
124 | reference: 'tabpanel',\r | |
125 | border: false,\r | |
126 | defaults: {\r | |
127 | bodyPadding: 10,\r | |
128 | scrollable: true,\r | |
129 | closable: true,\r | |
130 | border: false\r | |
131 | },\r | |
132 | bind: {\r | |
133 | tabPosition: '{positionBtn.value}',\r | |
134 | tabRotation: '{rotationBtn.value}'\r | |
135 | },\r | |
136 | items: [{\r | |
137 | title: 'Tab 1',\r | |
138 | icon: this.profileInfo.icon1,\r | |
139 | glyph: this.profileInfo.glyph1,\r | |
140 | html: KitchenSink.DummyText.longText\r | |
141 | }, {\r | |
142 | title: 'Tab 2',\r | |
143 | icon: this.profileInfo.icon2,\r | |
144 | glyph: this.profileInfo.glyph2,\r | |
145 | html: KitchenSink.DummyText.extraLongText\r | |
146 | }, {\r | |
147 | title: 'Tab 3',\r | |
148 | icon: this.profileInfo.icon3,\r | |
149 | glyph: this.profileInfo.glyph3,\r | |
150 | html: KitchenSink.DummyText.longText\r | |
151 | }]\r | |
152 | }]\r | |
153 | });\r | |
154 | \r | |
155 | this.callParent();\r | |
156 | }\r | |
157 | }); |