]>
Commit | Line | Data |
---|---|---|
6527f429 DM |
1 | Ext.define('KitchenSink.view.binding.Selection', {\r |
2 | extend: 'Ext.Container',\r | |
3 | \r | |
4 | //<example>\r | |
5 | otherContent: [{\r | |
6 | type: 'ViewModel',\r | |
7 | path: 'modern/src/view/binding/SelectionModel.js'\r | |
8 | }, {\r | |
9 | type: 'ViewModel',\r | |
10 | path: 'modern/src/model/Person.js'\r | |
11 | }],\r | |
12 | //</example>\r | |
13 | \r | |
14 | referenceHolder: true,\r | |
15 | \r | |
16 | viewModel: 'binding-selection',\r | |
17 | \r | |
18 | layout: {\r | |
19 | type: 'hbox',\r | |
20 | align: 'stretch'\r | |
21 | },\r | |
22 | \r | |
23 | items: [{\r | |
24 | xtype: 'list',\r | |
25 | flex: 1,\r | |
26 | itemTpl: '{lastName}, {firstName}',\r | |
27 | bind: '{people}',\r | |
28 | reference: 'peopleList'\r | |
29 | }, {\r | |
30 | xtype: 'formpanel',\r | |
31 | flex: 1,\r | |
32 | items: {\r | |
33 | xtype: 'fieldset',\r | |
34 | instructions: [\r | |
35 | 'The form is bound to the selection in the list. As the form ',\r | |
36 | 'fields change, the models in the list are automatically updated ',\r | |
37 | 'with the field input.'\r | |
38 | ].join(''),\r | |
39 | items: [{\r | |
40 | xtype: 'textfield',\r | |
41 | label: 'First Name',\r | |
42 | bind: '{peopleList.selection.firstName}'\r | |
43 | }, {\r | |
44 | xtype: 'textfield',\r | |
45 | label: 'Last Name',\r | |
46 | bind: '{peopleList.selection.lastName}'\r | |
47 | }]\r | |
48 | }\r | |
49 | }]\r | |
50 | }); |