3
* Copyright(c) 2006-2009 Ext JS, LLC
5
* http://www.extjs.com/license
7
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 tpl = new Ext.XTemplate(
19
'<div class="thumb-wrap" id="{name}">',
20
'<div class="thumb"><img src="{url}" title="{name}"></div>',
21
'<span class="x-editable">{shortName}</span></div>',
23
'<div class="x-clear"></div>'
26
var panel = new Ext.Panel({
33
title:'Simple DataView (0 items selected)',
35
items: new Ext.DataView({
40
overClass:'x-view-over',
41
itemSelector:'div.thumb-wrap',
42
emptyText: 'No images to display',
45
new Ext.DataView.DragSelector(),
46
new Ext.DataView.LabelEditor({dataIndex: 'name'})
49
prepareData: function(data){
50
data.shortName = Ext.util.Format.ellipsis(data.name, 15);
51
data.sizeString = Ext.util.Format.fileSize(data.size);
52
data.dateString = data.lastmod.format("m/d/Y g:i a");
58
fn: function(dv,nodes){
60
var s = l != 1 ? 's' : '';
61
panel.setTitle('Simple DataView ('+l+' item'+s+' selected)');
67
panel.render(document.body);
b'\\ No newline at end of file'