]>
Commit | Line | Data |
---|---|---|
6527f429 DM |
1 | Ext.define('KitchenSink.view.grid.TreeListModel', {\r |
2 | extend: 'Ext.app.ViewModel',\r | |
3 | \r | |
4 | alias: 'viewmodel.tree-list',\r | |
5 | \r | |
6 | formulas: {\r | |
7 | selectionText: function(get) {\r | |
8 | var selection = get('treelist.selection'),\r | |
9 | path;\r | |
10 | if (selection) {\r | |
11 | path = selection.getPath('text');\r | |
12 | path = path.replace(/^\/Root/, '');\r | |
13 | return 'Selected: ' + path;\r | |
14 | } else {\r | |
15 | return 'No node selected';\r | |
16 | }\r | |
17 | }\r | |
18 | }, \r | |
19 | \r | |
20 | stores: {\r | |
21 | navItems: {\r | |
22 | type: 'tree',\r | |
23 | root: {\r | |
24 | expanded: true,\r | |
25 | children: [{\r | |
26 | text: 'Home',\r | |
27 | iconCls: 'x-fa fa-home',\r | |
28 | children: [{\r | |
29 | text: 'Messages',\r | |
30 | iconCls: 'x-fa fa-inbox',\r | |
31 | leaf: true\r | |
32 | }, {\r | |
33 | text: 'Archive',\r | |
34 | iconCls: 'x-fa fa-database',\r | |
35 | children: [{\r | |
36 | text: 'First',\r | |
37 | iconCls: 'x-fa fa-sliders',\r | |
38 | leaf: true\r | |
39 | }, {\r | |
40 | text: 'No Icon',\r | |
41 | iconCls: null,\r | |
42 | leaf: true\r | |
43 | }]\r | |
44 | }, {\r | |
45 | text: 'Music',\r | |
46 | iconCls: 'x-fa fa-music',\r | |
47 | leaf: true\r | |
48 | }, {\r | |
49 | text: 'Video',\r | |
50 | iconCls: 'x-fa fa-film',\r | |
51 | leaf: true\r | |
52 | }]\r | |
53 | }, {\r | |
54 | text: 'Users',\r | |
55 | iconCls: 'x-fa fa-user',\r | |
56 | children: [{\r | |
57 | text: 'Tagged',\r | |
58 | iconCls: 'x-fa fa-tag',\r | |
59 | leaf: true\r | |
60 | }, {\r | |
61 | text: 'Inactive',\r | |
62 | iconCls: 'x-fa fa-trash',\r | |
63 | leaf: true\r | |
64 | }]\r | |
65 | }, {\r | |
66 | text: 'Groups',\r | |
67 | iconCls: 'x-fa fa-group',\r | |
68 | leaf: true\r | |
69 | }, {\r | |
70 | text: 'Settings',\r | |
71 | iconCls: 'x-fa fa-wrench',\r | |
72 | children: [{\r | |
73 | text: 'Sharing',\r | |
74 | iconCls: 'x-fa fa-share-alt',\r | |
75 | leaf: true\r | |
76 | }, {\r | |
77 | text: 'Notifications',\r | |
78 | iconCls: 'x-fa fa-flag',\r | |
79 | leaf: true\r | |
80 | }, {\r | |
81 | text: 'Network',\r | |
82 | iconCls: 'x-fa fa-signal',\r | |
83 | leaf: true\r | |
84 | }]\r | |
85 | }]\r | |
86 | }\r | |
87 | }\r | |
88 | }\r | |
89 | }); |