3 * Copyright(c) 2006-2010 Sencha Inc.
5 * http://www.sencha.com/license
8 Ext.onReady(function(){
10 var store = new Ext.data.JsonStore({
11 url: 'get-images.php',
13 fields: ['name', 'url', {name:'size', type: 'float'}, {name:'lastmod', type:'date', dateFormat:'timestamp'}]
17 var listView = new Ext.list.ListView({
20 emptyText: 'No images to display',
21 reserveScrollOffset: true,
28 header: 'Last Modified',
36 tpl: '{size:fileSize}',
38 cls: 'listview-filesize'
42 // put it in a Panel so it looks pretty
43 var panel = new Ext.Panel({
49 title:'Simple ListView <i>(0 items selected)</i>',
52 panel.render(document.body);
54 // little bit of feedback
55 listView.on('selectionchange', function(view, nodes){
57 var s = l != 1 ? 's' : '';
58 panel.setTitle('Simple ListView <i>('+l+' item'+s+' selected)</i>');