]> git.proxmox.com Git - sencha-touch.git/blob - src/examples/kitchensink/app/view/BasicList.js
import Sencha Touch 2.4.2 source
[sencha-touch.git] / src / examples / kitchensink / app / view / BasicList.js
1 /**
2 * Demonstrates how to create a simple List based on inline data.
3 * First we create a simple Contact 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.BasicList', {
8 extend: 'Ext.Container',
9 requires: ['Kitchensink.model.Contact'],
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 store: 'List',
22 itemTpl: '{firstName} {lastName}'
23 }]
24 }
25 });