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