X-Git-Url: http://git.ithinksw.org/extjs.git/blobdiff_plain/0494b8d9b9bb03ab6c22b34dae81261e3cd7e3e6..7a654f8d43fdb43d78b63d90528bed6e86b608cc:/examples/organizer/ImageView.js diff --git a/examples/organizer/ImageView.js b/examples/organizer/ImageView.js new file mode 100644 index 00000000..c59de516 --- /dev/null +++ b/examples/organizer/ImageView.js @@ -0,0 +1,70 @@ +/** + * @class Ext.org.ImageView + * @extends Ext.view.View + * @xtype imageview + * + * This class implements the "My Images" view (the images in the organizer). This class + * incorporates {@link Ext.ux.DataView.Draggable Draggable} to enable dragging items as + * well as {@link Ext.ux.DataView.DragSelector DragSelector} to allow multiple selection + * by simply clicking and dragging the mouse. + */ +Ext.define('Ext.org.ImageView', { + extend: 'Ext.view.View', + alias : 'widget.imageview', + requires: ['Ext.data.Store'], + mixins: { + dragSelector: 'Ext.ux.DataView.DragSelector', + draggable : 'Ext.ux.DataView.Draggable' + }, + + tpl: [ + '', + '
', + '
', + (!Ext.isIE6? '' : + '
'), + '
', + '{name}', + '
', + '
' + ], + + itemSelector: 'div.thumb-wrap', + multiSelect: true, + singleSelect: false, + cls: 'x-image-view', + autoScroll: true, + + initComponent: function() { + this.store = Ext.create('Ext.data.Store', { + autoLoad: true, + fields: ['name', 'thumb', {name: 'leaf', defaultValue: true}], + proxy: { + type: 'ajax', + url : '../view/chooser/icons.json', + reader: { + type: 'json', + root: '' + } + } + }); + + this.mixins.dragSelector.init(this); + this.mixins.draggable.init(this, { + ddConfig: { + ddGroup: 'organizerDD' + }, + ghostTpl: [ + '', + '', + '
', + '
', + '
', + '{[values.length]} images selected', + '
' + ] + }); + + this.callParent(); + } +}); \ No newline at end of file