X-Git-Url: http://git.ithinksw.org/extjs.git/blobdiff_plain/d41dc04ad17d1d9125fb2cf72db2b4782dbe3a8c..10a866c12701c0a0afd0ac85dcdcf32a421514ac:/examples/view/chooser.js?ds=inline
diff --git a/examples/view/chooser.js b/examples/view/chooser.js
index 4f8cfc94..273dc4d2 100644
--- a/examples/view/chooser.js
+++ b/examples/view/chooser.js
@@ -1,19 +1,9 @@
-/*
- * Ext JS Library 2.2.1
- * Copyright(c) 2006-2009, Ext JS, LLC.
- * licensing@extjs.com
- *
- * http://extjs.com/license
- */
-
-/*
- * Ext JS Library 2.0
- * Copyright(c) 2006-2007, Ext JS, LLC.
- * licensing@extjs.com
- *
- * http://extjs.com/license
- */
-
+/*!
+ * Ext JS Library 3.1.0
+ * Copyright(c) 2006-2009 Ext JS, LLC
+ * licensing@extjs.com
+ * http://www.extjs.com/license
+ */
var ImageChooser = function(config){
this.config = config;
}
@@ -21,11 +11,11 @@ var ImageChooser = function(config){
ImageChooser.prototype = {
// cache data by image name for easy lookup
lookup : {},
-
+
show : function(el, callback){
if(!this.win){
this.initTemplates();
-
+
this.store = new Ext.data.JsonStore({
url: this.config.url,
root: 'images',
@@ -39,7 +29,7 @@ ImageChooser.prototype = {
}
});
this.store.load();
-
+
var formatSize = function(data){
if(data.size < 1024) {
return data.size + " bytes";
@@ -47,7 +37,7 @@ ImageChooser.prototype = {
return (Math.round(((data.size*10) / 1024))/10) + " KB";
}
};
-
+
var formatData = function(data){
data.shortName = data.name.ellipse(15);
data.sizeString = formatSize(data);
@@ -55,7 +45,7 @@ ImageChooser.prototype = {
this.lookup[data.name] = data;
return data;
};
-
+
this.view = new Ext.DataView({
tpl: this.thumbTemplate,
singleSelect: true,
@@ -73,7 +63,7 @@ ImageChooser.prototype = {
},
prepareData: formatData.createDelegate(this)
});
-
+
var cfg = {
title: 'Choose an Image',
id: 'img-chooser-dlg',
@@ -116,7 +106,7 @@ ImageChooser.prototype = {
valueField: 'name',
lazyInit: false,
value: 'name',
- store: new Ext.data.SimpleStore({
+ store: new Ext.data.ArrayStore({
fields: ['name', 'desc'],
data : [['name', 'Name'],['size', 'File Size'],['lastmod', 'Last Modified']]
}),
@@ -151,13 +141,13 @@ ImageChooser.prototype = {
Ext.apply(cfg, this.config);
this.win = new Ext.Window(cfg);
}
-
+
this.reset();
this.win.show(el);
this.callback = callback;
this.animateTarget = el;
},
-
+
initTemplates : function(){
this.thumbTemplate = new Ext.XTemplate(
'