]> git.proxmox.com Git - extjs.git/blame - extjs/examples/classic/ticket-app/app/view/user/User.js
add extjs 6.0.1 sources
[extjs.git] / extjs / examples / classic / ticket-app / app / view / user / User.js
CommitLineData
6527f429
DM
1/**\r
2 * This class defines the User editing view.\r
3 */\r
4Ext.define('Ticket.view.user.User', {\r
5 extend: 'Ext.window.Window',\r
6 \r
7 controller: 'user', // links to Ticket.view.user.UserController\r
8 \r
9 width: 300,\r
10 minHeight: 250,\r
11 height: 450,\r
12 bodyPadding: 10,\r
13 layout: {\r
14 type: 'vbox',\r
15 align: 'stretch'\r
16 },\r
17\r
18 // As a Window the default property we are binding is "title":\r
19 bind: 'Edit User: {theUser.name}',\r
20\r
21 modal: true,\r
22\r
23 tools: [{\r
24 type: 'gear',\r
25 tooltip: 'Edit Groups',\r
26\r
27 // Call is routed to our ViewController (Ticket.view.user.UserController):\r
28 callback: 'onGroupsClick'\r
29 }],\r
30 \r
31 items: [{\r
32 xtype: 'textfield',\r
33 fieldLabel: 'Name',\r
34 labelWidth: 70,\r
35\r
36 // As a textfield the default property we are binding is "value":\r
37 bind: '{theUser.name}'\r
38 }, {\r
39 // The multiselector is basically a grid that displays the currently selected\r
40 // items. To add items there is a Search tool configured below.\r
41 xtype: 'multiselector',\r
42 bind: '{theUser.groups}',\r
43\r
44 title: 'Groups',\r
45\r
46 flex: 1,\r
47 margin: '10 0',\r
48\r
49 // This configures the Search popup. In this case we want to browse all groups.\r
50 search: {\r
51 store: {\r
52 model: 'Group'\r
53 }\r
54 }\r
55 }],\r
56\r
57 buttons: [{\r
58 text: 'Groups',\r
59 listeners: {\r
60 // Call is routed to our ViewController (Ticket.view.user.UserController):\r
61 click: 'onGroupsClick'\r
62 }\r
63 }, '->', {\r
64 text: 'Close',\r
65 listeners: {\r
66 // Call is routed to our ViewController (Ticket.view.user.UserController) but\r
67 // the "closeView" method is a helper inherited from Ext.app.ViewController.\r
68 click: 'closeView'\r
69 }\r
70 }]\r
71});\r