]>
Commit | Line | Data |
---|---|---|
6527f429 DM |
1 | /**\r |
2 | * Demonstrates how to create a simple List based on inline data.\r | |
3 | * First we create a simple Person model with first and last name fields, then we create a Store to contain\r | |
4 | * the data, finally we create the List itself, which gets its data out of the Store\r | |
5 | */\r | |
6 | \r | |
7 | Ext.define('KitchenSink.view.DisclosureList', {\r | |
8 | extend: 'Ext.Container',\r | |
9 | requires: ['KitchenSink.model.Person'],\r | |
10 | config: {\r | |
11 | layout: Ext.os.deviceType == 'Phone' ? 'fit' : {\r | |
12 | type: 'vbox',\r | |
13 | align: 'center',\r | |
14 | pack: 'center'\r | |
15 | },\r | |
16 | cls: 'demo-list',\r | |
17 | items: [{\r | |
18 | width: Ext.os.deviceType == 'Phone' ? null : '50%',\r | |
19 | height: Ext.os.deviceType == 'Phone' ? null : '80%',\r | |
20 | xtype: 'list',\r | |
21 | onItemDisclosure: function(record, btn, index) {\r | |
22 | Ext.Msg.alert('Tap', 'Disclose more info for ' + record.get('firstName'), Ext.emptyFn);\r | |
23 | },\r | |
24 | store: 'List',\r | |
25 | itemTpl: '{firstName} {lastName}'\r | |
26 | }]\r | |
27 | }\r | |
28 | });\r |