]>
git.proxmox.com Git - extjs.git/blob - extjs/build/examples/classic/grid/list-view.js
6 Ext
.onReady(function(){
7 Ext
.define('ImageModel', {
8 extend
: 'Ext.data.Model',
9 fields
: ['name', 'url', {name
:'size', type
: 'float'}, {name
:'lastmod', type
:'date', dateFormat
:'timestamp'}]
11 var store
= Ext
.create('Ext.data.JsonStore', {
15 url
: 'get-images.php',
18 rootProperty
: 'images'
24 var listView
= Ext
.create('Ext.grid.Panel', {
28 title
:'Simple ListView <i>(0 items selected)</i>',
29 renderTo
: Ext
.getBody(),
34 emptyText
: 'No images to display'
39 flex
: (Ext
.themeName
=== 'neptune-touch' || Ext
.themeName
=== 'crisp') ? 47: 50,
42 text
: 'Last Modified',
50 tpl
: '{size:fileSize}',
52 flex
: (Ext
.themeName
=== 'neptune-touch' || Ext
.themeName
=== 'crisp') ? 18: 15,
53 cls
: 'listview-filesize'
57 // little bit of feedback
58 listView
.on('selectionchange', function(view
, nodes
){
59 var len
= nodes
.length
,
60 suffix
= len
=== 1 ? '' : 's',
61 str
= 'Simple ListView <i>({0} item{1} selected)</i>';
63 listView
.setTitle(Ext
.String
.format(str
, len
, suffix
));