-\r
-Ext.onReady(function(){\r
-\r
- var store = new Ext.data.JsonStore({\r
- url: 'get-images.php',\r
- root: 'images',\r
- fields: ['name', 'url', {name:'size', type: 'float'}, {name:'lastmod', type:'date', dateFormat:'timestamp'}]\r
- });\r
- store.load();\r
-\r
- var listView = new Ext.list.ListView({\r
- store: store,\r
- multiSelect: true,\r
- emptyText: 'No images to display',\r
- reserveScrollOffset: true,\r
-\r
- columns: [{\r
- header: 'File',\r
- width: .5,\r
- dataIndex: 'name'\r
- },{\r
- header: 'Last Modified',\r
- xtype: 'datecolumn',\r
- format: 'm-d h:i a',\r
- width: .35, \r
- dataIndex: 'lastmod'\r
- },{\r
- header: 'Size',\r
- dataIndex: 'size',\r
- tpl: '{size:fileSize}',\r
- align: 'right',\r
- cls: 'listview-filesize'\r
- }]\r
- });\r
- \r
- // put it in a Panel so it looks pretty\r
- var panel = new Ext.Panel({\r
- id:'images-view',\r
- width:425,\r
- height:250,\r
- collapsible:true,\r
- layout:'fit',\r
- title:'Simple ListView <i>(0 items selected)</i>',\r
- items: listView\r
- });\r
- panel.render(document.body);\r
-\r
- // little bit of feedback\r
- listView.on('selectionchange', function(view, nodes){\r
- var l = nodes.length;\r
- var s = l != 1 ? 's' : '';\r
- panel.setTitle('Simple ListView <i>('+l+' item'+s+' selected)</i>');\r
- });\r
+
+Ext.onReady(function(){
+
+ var store = new Ext.data.JsonStore({
+ url: 'get-images.php',
+ root: 'images',
+ fields: ['name', 'url', {name:'size', type: 'float'}, {name:'lastmod', type:'date', dateFormat:'timestamp'}]
+ });
+ store.load();
+
+ var listView = new Ext.list.ListView({
+ store: store,
+ multiSelect: true,
+ emptyText: 'No images to display',
+ reserveScrollOffset: true,
+
+ columns: [{
+ header: 'File',
+ width: .5,
+ dataIndex: 'name'
+ },{
+ header: 'Last Modified',
+ xtype: 'datecolumn',
+ format: 'm-d h:i a',
+ width: .35,
+ dataIndex: 'lastmod'
+ },{
+ header: 'Size',
+ dataIndex: 'size',
+ tpl: '{size:fileSize}',
+ align: 'right',
+ cls: 'listview-filesize'
+ }]
+ });
+
+ // put it in a Panel so it looks pretty
+ var panel = new Ext.Panel({
+ id:'images-view',
+ width:425,
+ height:250,
+ collapsible:true,
+ layout:'fit',
+ title:'Simple ListView <i>(0 items selected)</i>',
+ items: listView
+ });
+ panel.render(document.body);
+
+ // little bit of feedback
+ listView.on('selectionchange', function(view, nodes){
+ var l = nodes.length;
+ var s = l != 1 ? 's' : '';
+ panel.setTitle('Simple ListView <i>('+l+' item'+s+' selected)</i>');
+ });