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