]> git.proxmox.com Git - extjs.git/blame - extjs/examples/kitchensink/classic/samples/view/toolbar/Breadcrumb.js
add extjs 6.0.1 sources
[extjs.git] / extjs / examples / kitchensink / classic / samples / view / toolbar / Breadcrumb.js
CommitLineData
6527f429
DM
1/**\r
2 * Demonstrates a breadcrumb toolbar. A breadcrumb component is just another way of\r
3 * navigating hierarchical data structures. It is bound to a standard tree store and\r
4 * allows the user to set the selected node by clicking on the navigation buttons.\r
5 */\r
6Ext.define('KitchenSink.view.toolbar.Breadcrumb', {\r
7 extend: 'Ext.panel.Panel',\r
8 xtype: 'breadcrumb-toolbar',\r
9 id: 'breadcrumb-toolbar',\r
10 //<example>\r
11 exampleTitle: 'Breadcrumb Toolbar',\r
12 otherContent: [{\r
13 type: 'store',\r
14 path: 'classic/samples/store/Files.js'\r
15 }],\r
16 profiles: {\r
17 classic: {\r
18 width: 380\r
19 },\r
20 neptune: {\r
21 width: 500\r
22 },\r
23 'neptune-touch': {\r
24 width: 620\r
25 }\r
26 },\r
27 //</example>\r
28\r
29 overflowHandler: 'scroller',\r
30\r
31 height: 400,\r
32\r
33 html: KitchenSink.DummyText.longText,\r
34 bodyPadding: 20,\r
35\r
36 initComponent: function() {\r
37 var store = new KitchenSink.store.Files();\r
38\r
39 this.width = this.profileInfo.width;\r
40\r
41 //<example>\r
42 // TODO: when using KitchenSink.store.Files(), nodes with children (e.g. app, or button)\r
43 // will return false when hasChildNodes() is called. When using the exact\r
44 // same data inline, the problem does not occur. Remove this workaround when fixed.\r
45 store = new Ext.data.TreeStore({\r
46 root: {\r
47 expanded: true,\r
48 children: [\r
49 {\r
50 text: 'app',\r
51 children: [\r
52 { leaf:true, text: 'Application.js' }\r
53 ]\r
54 },\r
55 {\r
56 text: 'button',\r
57 expanded: true,\r
58 children: [\r
59 { leaf:true, text: 'Button.js' },\r
60 { leaf:true, text: 'Cycle.js' },\r
61 { leaf:true, text: 'Split.js' }\r
62 ]\r
63 },\r
64 {\r
65 text: 'container',\r
66 children: [\r
67 { leaf:true, text: 'ButtonGroup.js' },\r
68 { leaf:true, text: 'Container.js' },\r
69 { leaf:true, text: 'Viewport.js' }\r
70 ]\r
71 },\r
72 {\r
73 text: 'core',\r
74 children: [\r
75 {\r
76 text: 'dom',\r
77 children: [\r
78 { leaf:true, text: 'Element.form.js' },\r
79 { leaf:true, text: 'Element.static-more.js' }\r
80 ]\r
81 }\r
82 ]\r
83 },\r
84 {\r
85 text: 'dd',\r
86 children: [\r
87 { leaf:true, text: 'DD.js' },\r
88 { leaf:true, text: 'DDProxy.js' },\r
89 { leaf:true, text: 'DDTarget.js' },\r
90 { leaf:true, text: 'DragDrop.js' },\r
91 { leaf:true, text: 'DragDropManager.js' },\r
92 { leaf:true, text: 'DragSource.js' },\r
93 { leaf:true, text: 'DragTracker.js' },\r
94 { leaf:true, text: 'DragZone.js' },\r
95 { leaf:true, text: 'DragTarget.js' },\r
96 { leaf:true, text: 'DragZone.js' },\r
97 { leaf:true, text: 'Registry.js' },\r
98 { leaf:true, text: 'ScrollManager.js' },\r
99 { leaf:true, text: 'StatusProxy.js' }\r
100 ]\r
101 },\r
102 {\r
103 text: 'core',\r
104 children: [\r
105 { leaf:true, text: 'Element.alignment.js' },\r
106 { leaf:true, text: 'Element.anim.js' },\r
107 { leaf:true, text: 'Element.dd.js' },\r
108 { leaf:true, text: 'Element.fx.js' },\r
109 { leaf:true, text: 'Element.js' },\r
110 { leaf:true, text: 'Element.position.js' },\r
111 { leaf:true, text: 'Element.scroll.js' },\r
112 { leaf:true, text: 'Element.style.js' },\r
113 { leaf:true, text: 'Element.traversal.js' },\r
114 { leaf:true, text: 'Helper.js' },\r
115 { leaf:true, text: 'Query.js' }\r
116 ]\r
117 },\r
118 { leaf:true, text: 'Action.js' },\r
119 { leaf:true, text: 'Component.js' },\r
120 { leaf:true, text: 'Editor.js' },\r
121 { leaf:true, text: 'Img.js' },\r
122 { leaf:true, text: 'Layer.js' },\r
123 { leaf:true, text: 'LoadMask.js' },\r
124 { leaf:true, text: 'ProgressBar.js' },\r
125 { leaf:true, text: 'Shadow.js' },\r
126 { leaf:true, text: 'ShadowPool.js' },\r
127 { leaf:true, text: 'ZIndexManager.js' }\r
128 ]\r
129 }\r
130 });\r
131 //</example>\r
132 this.tbar = [{\r
133 xtype: 'breadcrumb',\r
134 store: store,\r
135 showIcons: true,\r
136 // Start with "Ext JS > dd > DragZone.js" selected\r
137 selection: store.getRoot().childNodes[4].childNodes[7]\r
138 }];\r
139\r
140 this.callParent();\r
141 }\r
142});