]>
Commit | Line | Data |
---|---|---|
6527f429 DM |
1 | /**\r |
2 | * This example illustrates a combo box which loads the data source from a server\r | |
3 | * but queries the local result set. It uses a custom item template for the dropdown list.\r | |
4 | */\r | |
5 | Ext.define('KitchenSink.view.form.combobox.RemoteLoad', {\r | |
6 | extend: 'Ext.form.Panel',\r | |
7 | xtype: 'remote-loaded-combo',\r | |
8 | \r | |
9 | //<example>\r | |
10 | requires: [\r | |
11 | 'KitchenSink.model.State',\r | |
12 | 'KitchenSink.store.RemoteStates'\r | |
13 | ],\r | |
14 | \r | |
15 | exampleTitle: 'Remote loaded ComboBox',\r | |
16 | otherContent: [{\r | |
17 | type: 'Model',\r | |
18 | path: 'classic/samples/model/State.js'\r | |
19 | }, {\r | |
20 | type: 'Store',\r | |
21 | path: 'classic/samples/store/RemoteStates.js'\r | |
22 | }],\r | |
23 | //</example>\r | |
24 | \r | |
25 | title: 'Remote loaded ComboBox',\r | |
26 | width: 500,\r | |
27 | layout: 'form',\r | |
28 | viewModel: {},\r | |
29 | \r | |
30 | items: [{\r | |
31 | xtype: 'fieldset',\r | |
32 | layout: 'anchor',\r | |
33 | items: [{\r | |
34 | xtype: 'component',\r | |
35 | anchor: '100%',\r | |
36 | html: [\r | |
37 | '<h3>Remote loaded, local query mode</h3>',\r | |
38 | '<p>This ComboBox uses remotely loaded data, to perform querying ',\r | |
39 | 'client side.</p>',\r | |
40 | '<p>This is suitable when the dataset is not too big or dynamic ',\r | |
41 | 'to be manipulated locally.</p>',\r | |
42 | '<p>This example uses a custom template for the dropdown list ',\r | |
43 | 'to illustrate grouping.</p>'\r | |
44 | ]\r | |
45 | }, {\r | |
46 | xtype: 'displayfield',\r | |
47 | fieldLabel: 'Selected State',\r | |
48 | bind: '{states.value}'\r | |
49 | }, {\r | |
50 | xtype: 'combobox',\r | |
51 | reference: 'states',\r | |
52 | publishes: 'value',\r | |
53 | fieldLabel: 'Select State',\r | |
54 | displayField: 'state',\r | |
55 | anchor: '-15',\r | |
56 | store: {\r | |
57 | type: 'remote-states',\r | |
58 | autoLoad: true\r | |
59 | },\r | |
60 | minChars: 0,\r | |
61 | queryMode: 'local',\r | |
62 | tpl: [\r | |
63 | '<ul class="x-list-plain">',\r | |
64 | '<tpl for=".">',\r | |
65 | '<li class="',\r | |
66 | Ext.baseCSSPrefix, 'grid-group-hd ',\r | |
67 | Ext.baseCSSPrefix, 'grid-group-title">{abbr}</li>',\r | |
68 | '<li class="x-boundlist-item">',\r | |
69 | '{state}, {description}',\r | |
70 | '</li>',\r | |
71 | '</tpl>',\r | |
72 | '</ul>'\r | |
73 | ]\r | |
74 | }]\r | |
75 | }]\r | |
76 | });\r |