UNPKG

extjs-gpl

Version:

GPL licensed version of Sencha Ext JS

68 lines (63 loc) 2.01 kB
/** * @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: [ '<tpl for=".">', '<div class="thumb-wrap">', '<div class="thumb">', '<img src="../view/chooser/icons/{thumb}" />', '</div>', '<span>{name}</span>', '</div>', '</tpl>' ], itemSelector: 'div.thumb-wrap', multiSelect: true, singleSelect: false, cls: 'x-image-view', scrollable: true, initComponent: function() { this.store = new Ext.data.Store({ autoLoad: true, model: 'Ext.org.Image', proxy: { type: 'ajax', url : '../view/chooser/icons.json', reader: { type: 'json' } } }); this.mixins.dragSelector.init(this); this.mixins.draggable.init(this, { ddConfig: { ddGroup: 'organizerDD' }, ghostTpl: [ '<tpl for=".">', '<img src="../view/chooser/icons/{thumb}" />', '<tpl if="xindex % 4 == 0"><br /></tpl>', '</tpl>', '<div class="count">', '{[values.length]} images selected', '<div>' ] }); this.callParent(); } });