extjs4.1后台管理图标修改。
来源:互联网 发布:淘宝新规处罚规定 编辑:程序博客网 时间:2024/05/16 17:41
基本思路在再官方例子中来。
/** * @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('Sharera.system.util.ImageOragnizer', { extend: 'Ext.view.View', alias : 'widget.imageview', src:'', requires: ['Ext.data.Store'], mixins: { dragSelector: 'Ext.ux.DataView.DragSelector', draggable : 'Ext.ux.DataView.Draggable' }, itemSelector: 'div.thumb-wrap', emptyText: '没有图片', multiSelect: false, singleSelect: true, cls: 'x-image-view', autoScroll: true, initComponent: function() { var self = this; this.tpl=[ '<tpl for=".">', '<div class="thumb-wrap">', '<div class="thumb">', /*'<img src="../js/extjs/icons/img/{thumb}" />',*/ '<img src='+self.src+'/{thumb} />', '</div>', /* '<span>{name}</span>',*/ '</div>', '</tpl>' ], this.store = Ext.create('Ext.data.Store', { autoLoad: true, fields: ['name', 'thumb', {name: 'leaf', defaultValue: true}], proxy: { type: 'ajax', url : context+'admin/system/icons.json', reader: { type: 'json', root: '' } } }); this.mixins.dragSelector.init(this); this.mixins.draggable.init(this, { ddConfig: { ddGroup: 'organizerDD' }, ghostTpl: [ '<tpl for=".">', '<img src="'+self.src+'/{thumb}" />', '<tpl if="xindex % 4 == 0"><br /></tpl>', '</tpl>', '<div class="count">', '{[values.length]} images selected', '<div>' ] }); this.callParent(); }});
text : 'image',iconCls : 'x-tbar-loading',scope : this,handler : function(){ var win = Ext.create("Ext.window.Window",{title: '双击选择图片', height: 200, width: 400, layout: 'fit', items: [{ xtype: 'panel', frame:true, layout:'fit', items: { xtype: 'imageview', src:'../js/extjs/icons/img', listeners: { itemdblclick: function (view,record, item,index, e,eOpts) { console.debug(record); } }, trackOver: true }}] }) win.show();}
[ { name: '添加用户', thumb: 'user_add.png', url: 'kitchensink', type: 'Application' }, { name: '删除用户', thumb: 'delete.png', url: 'twitter', type: 'Application' }, { name: '添加用户', thumb: 'user_add.png', url: 'kitchensink', type: 'Application' }, { name: '删除用户', thumb: 'delete.png', url: 'twitter', type: 'Application' }, { name: '添加用户', thumb: 'user_add.png', url: 'kitchensink', type: 'Application' }, { name: '删除用户', thumb: 'delete.png', url: 'twitter', type: 'Application' }, { name: '添加用户', thumb: 'user_add.png', url: 'kitchensink', type: 'Application' }, { name: '删除用户', thumb: 'delete.png', url: 'twitter', type: 'Application' }, { name: '删除用户', thumb: 'delete.png', url: 'twitter', type: 'Application' }, { name: '删除用户', thumb: 'delete.png', url: 'twitter', type: 'Application' }, { name: '删除用户', thumb: 'delete.png', url: 'twitter', type: 'Application' }, { name: '删除用户', thumb: 'delete.png', url: 'twitter', type: 'Application' }, { name: '删除用户', thumb: 'delete.png', url: 'twitter', type: 'Application' }, { name: '删除用户', thumb: 'delete.png', url: 'twitter', type: 'Application' }, { name: '删除用户', thumb: 'delete.png', url: 'twitter', type: 'Application' }, { name: '删除用户', thumb: 'delete.png', url: 'twitter', type: 'Application' }, { name: '删除用户', thumb: 'delete.png', url: 'twitter', type: 'Application' }, { name: '删除用户', thumb: 'delete.png', url: 'twitter', type: 'Application' }, { name: '删除用户', thumb: 'delete.png', url: 'twitter', type: 'Application' }, { name: '删除用户', thumb: 'delete.png', url: 'twitter', type: 'Application' }, { name: '删除用户', thumb: 'delete.png', url: 'twitter', type: 'Application' }, { name: '删除用户', thumb: 'delete.png', url: 'twitter', type: 'Application' }]
/*Sharera.system.util.ImageOragnizer的样式*/.x-image-view{ font: 11px Arial, Helvetica, sans-serif;}.x-image-view .thumb{ padding:3px;}.x-image-view .thumb-wrap{ float: left; margin: 4px; margin-right: 0; padding: 5px;}.x-image-view .thumb-wrap span{ display: block; overflow: hidden; text-align: center; width: 76px; /* for ie to ensure that the text is centered */}.x-image-view .x-item-selected .thumb { background:#8db2e3;}.x-image-view .loading-indicator { font-size:8pt; background-repeat: no-repeat; background-position: left; padding-left:20px; margin:10px;}
效果丑了点,不过也是可以实现功能
0 0
- extjs4.1后台管理图标修改。
- 修改后台管理路径
- Extjs4---用MVC做的后台管理系统 之一
- Extjs4---用MVC做的后台管理系统 之二
- Extjs4---用MVC做的后台管理系统 之三
- 修改Magento后台管理目录
- ECShop后台管理菜单修改
- ECShop后台管理菜单修改
- ECShop后台管理菜单修改
- PHP后台管理类(修改中)
- extjs4.1中后台传过来的json
- ExtJS4 actioncolumn动态显示图标
- 后台管理1
- php管理后台1
- 修改extjs4默认字体
- extjs4 tab 样式修改
- ExtJs4修改默认字体
- 后台管理系统常用的Font Awesome图标及图标自定义方法
- 市委组织部项目--office文档上传后预览
- Binary Tree Level Order Traversal
- 递归题:话说一个小球从100米空中落下,每次反弹一半高度,请问第12次反弹的高度是多少,小球总共经过多少米?
- 豆瓣工程副总:谈谈技术团队的管理
- 数学结构之二叉树学习
- extjs4.1后台管理图标修改。
- Android浏览器清单文件关键配置和浏览器的调用
- Android ListView实现方法二
- se
- squid介绍及其简单配置
- 在Ubuntu 10.04中搭建Objective-C 开发环境
- Maven应该掌握的五个核心概念
- Hibernate:一对多双向关联关系
- Spring加载applicationContext.xml的几种方式