X-Git-Url: http://git.ithinksw.org/extjs.git/blobdiff_plain/6a7e4474cba9d8be4b2ec445e10f1691f7277c50..7a654f8d43fdb43d78b63d90528bed6e86b608cc:/examples/view/animated-dataview.js diff --git a/examples/view/animated-dataview.js b/examples/view/animated-dataview.js index 249f7256..e3a03fb5 100644 --- a/examples/view/animated-dataview.js +++ b/examples/view/animated-dataview.js @@ -1,20 +1,20 @@ -/*! - * Ext JS Library 3.2.0 - * Copyright(c) 2006-2010 Ext JS, Inc. - * licensing@extjs.com - * http://www.extjs.com/license - */ +Ext.Loader.setConfig({enabled: true}); +Ext.Loader.setPath('Ext.ux.DataView', '../ux/DataView/'); + +Ext.require([ + 'Ext.data.*', + 'Ext.util.*', + 'Ext.view.View', + 'Ext.ux.DataView.Animated', + 'Ext.XTemplate', + 'Ext.panel.Panel', + 'Ext.toolbar.*', + 'Ext.slider.Multi' +]); + Ext.onReady(function() { - var store = new Ext.data.ArrayStore({ - proxy : new Ext.data.MemoryProxy(), - fields : ['hasEmail', 'hasCamera', 'id', 'name', 'price', 'screen', 'camera', 'color', 'type', 'reviews', 'screen-size'], - sortInfo: { - field : 'name', - direction: 'ASC' - } - }); - - store.loadData([ + //data to be loaded into the ArrayStore + var data = [ [true, false, 1, "LG KS360", 54, "240 x 320 pixels", "2 Megapixel", "Pink", "Slider", 359, 2.400000], [true, true, 2, "Sony Ericsson C510a Cyber-shot", 180, "320 x 240 pixels", "3.2 Megapixel", "Future black", "Candy bar", 11, 0.000000], [true, true, 3, "LG PRADA KE850", 155, "240 x 400 pixels", "2 Megapixel", "Black", "Candy bar", 113, 0.000000], @@ -35,52 +35,68 @@ Ext.onReady(function() { [true, true, 18, "LG Xenon GR500", 1, "240 x 400 pixels", "2 Megapixel", "Red", "Slider", 658, 2.800000], [true, false, 19, "BlackBerry Curve 8900 BlackBerry", 349, "480 x 360 pixels", "3.2 Megapixel", "", "Candy bar", 21, 2.440000], [true, false, 20, "Samsung SGH U600 Ultra Edition 10.9", 135, "240 x 320 pixels", "3.2 Megapixel", "", "Slider", 169, 2.200000] - ]); - - var dataview = new Ext.DataView({ + ]; + + Ext.define('Mobile', { + extend: 'Ext.data.Model', + fields: [ + {name: 'hasEmail', type: 'bool'}, + {name: 'hasCamera', type: 'bool'}, + {name: 'id', type: 'int'}, + 'name', + {name: 'price', type: 'int'}, + 'screen', + 'camera', + 'color', + 'type', + {name: 'reviews', type: 'int'}, + {name: 'screen-size', type: 'int'} + ] + }); + + var store = Ext.create('Ext.data.ArrayStore', { + model: 'Mobile', + sortInfo: { + field : 'name', + direction: 'ASC' + }, + data: data + }); + + var dataview = Ext.create('Ext.view.View', { store: store, - tpl : new Ext.XTemplate( - '