]>
Commit | Line | Data |
---|---|---|
6527f429 DM |
1 | Ext.define('KitchenSink.view.binding.TwoWay', {\r |
2 | extend: 'Ext.form.Panel',\r | |
3 | \r | |
4 | //<example>\r | |
5 | requires: [\r | |
6 | 'Ext.app.ViewModel'\r | |
7 | ],\r | |
8 | \r | |
9 | otherContent: [{\r | |
10 | type: 'ViewController',\r | |
11 | path: 'modern/src/view/binding/TwoWayController.js'\r | |
12 | }],\r | |
13 | //</example>\r | |
14 | \r | |
15 | controller: 'binding-twoway',\r | |
16 | \r | |
17 | viewModel: {\r | |
18 | data: {\r | |
19 | title: 'Default Title'\r | |
20 | }\r | |
21 | },\r | |
22 | \r | |
23 | items: [{\r | |
24 | xtype: 'titlebar',\r | |
25 | docked: 'top',\r | |
26 | bind: '{title}',\r | |
27 | items: [{\r | |
28 | text: 'Random Title',\r | |
29 | handler: 'makeRandomTitle'\r | |
30 | }]\r | |
31 | }, {\r | |
32 | xtype: 'fieldset',\r | |
33 | instructions: [\r | |
34 | 'Change the text field which will alter the title bar text using binding. ',\r | |
35 | 'The random title button sets the title on the ViewModel, which is propagated to ',\r | |
36 | 'both the field and the title bar text.'\r | |
37 | ].join(''),\r | |
38 | items: {\r | |
39 | xtype: 'textfield',\r | |
40 | label: 'Title',\r | |
41 | bind: '{title}'\r | |
42 | }\r | |
43 | }]\r | |
44 | }); |