extjs swfupload
var uploadFilesWin = new Ext.Window({
title : '多文件上传',
width : 500,
height : 300,
resizable : false,
layout : 'fit',
items : [{
xtype : 'uploadpanel',
uploadUrl : 'uploadpanel',
filePostName : '',
flashUrl : '',
fileSize : '1024*550',
height : 400,
border : false,
fileTypes : '*.*', // 在这里限制文件类型:'*.jpg,*.png,*.gif'
fileTypesDescription : '所有文件',
postParams : {
path : 'files\\' // 上传到服务器的files目录下面
}
}],
bbar : ['xaaaxx'] [code=html]});
uploadFilesWin.show();[/code]
uploadpanel代码
UploadPanel = Ext.extend(Ext.Panel, {
fileList : null,
swfupload : null,
progressBar : null,
progressInfo : null,
uploadInfoPanel : null,
constructor : function(config) {
//定义 panel1 中的初始信息
this.progressInfo = {
filesTotal : 0,
filesUploaded : 0,
bytesTotal : 0,
bytesUploaded : 0,
currentCompleteBytes : 0,
lastBytes : 0,
lastElapsed : 1,
lastUpdate : null,
timeElapsed : 1
};
//定义panel1,包括他的位置大小等信息
this.uploadInfoPanel = new Ext.Panel({
region : 'north',
height : 65,
baseCls : '',
collapseMode : 'mini',
split : true,
border : false
});
this.progressBar = new Ext.ProgressBar({
text : '等待中 0 %',
animate : true
});
this.uploadInfoPanel.on('render', function() {
this.getProgressTemplate().overwrite(this.uploadInfoPanel.body, {
filesUploaded : 0,
filesTotal : 0,
bytesUploaded : '0 bytes',
bytesTotal : '0 bytes',
timeElapsed : '00:00:00',
timeLeft : '00:00:00',
speedLast : '0 bytes/s',
speedAverage : '0 bytes/s'
});
}, this);
//定义panel2的数据列以及工具条
this.fileList = new Ext.grid.GridPanel({
border : false,
enableColumnMove : false,
enableHdMenu : false,
columns : [new Ext.grid.RowNumberer(), {
header : '文件名',
width : 100,
dataIndex : 'fileName',
sortable : false,
fixed : true,
//renderer : this.formatFileName,
id : autoExpandColumnId
}, {
header : '大小',
width : 80,
dataIndex : 'fileSize',
sortable : false,
fixed : true,
//renderer : this.formatFileSize,
align : 'right'
}, {
header : '类型',
width : 60,
dataIndex : 'fileType',
sortable : false,
fixed : true,
//renderer : this.formatIcon,
align : 'center'
}, {
header : '进度',
width : 100,
dataIndex : '',
sortable : false,
fixed : true,
//renderer : this.formatProgressBar,
align : 'center'
}, {
header : ' ',
width : 28,
dataIndex : 'fileState',
//renderer : this.formatState,
sortable : false,
fixed : true,
align : 'center'
}],
autoExpandColumn : autoExpandColumnId,
ds : new Ext.data.SimpleStore({
fields : ['fileId', 'fileName', 'fileSize', 'fileType', 'fileState']
}),
bbar : [this.progressBar],
tbar : [{
text : '添加文件',
iconCls : 'db-icn-add'
}, {
text : '开始上传',
iconCls : 'db-icn-upload_',
handler : this.startUpload,
scope : this
}, {
text : '停止上传',
iconCls : 'db-icn-stop',
handler : this.stopUpload,
scope : this
}, {
text : '取消队列',
iconCls : 'db-icn-cross',
handler : this.cancelQueue,
scope : this
}, {
text : '清空列表',
iconCls : 'db-icn-trash',
handler : this.clearList,
scope : this
}]
});
}
});
Ext.reg('uploadpanel',UploadPanel);
...全文
相关推荐
Extjs4 swfupload多文件上传
支持多文件上传,支持上传时,选文件进行文件类型限制,同样支持文件大小在选文件时限制。
多文件上传系统实现:基于swfupload、extjs与Java
swfupload是一个支持多文件上传、带有图形用户界面的Flash组件。它提供了许多高级功能,如上传进度条、上传队列管理、自定义上传按钮和各种事件处理机制,从而提升了用户体验。它被广泛用于开发跨浏览器的文件上传功能。Ext JS提供了大量的预构建组件,这些组件可以极大地加速用户界面的开发。以下是一些核心组件的介绍和基本使用方法:Panel组件:这是一个容器组件,可以包含标题、工具栏、边框等。它可以作为应用程序的主界面,容纳其他组件。// Panel组件示例代码});Grid组件。
extjs3 swfupload panel
网上好不容易才找到的,可以用,而且是EXTJS3下可以使用,和大家分享下,如果用不了,请看看你的FLASH版本,运行TMP.HTM就可以了
Extjs Swfupload 多图上传插件绝对可运行
Extjs Swfupload 自己改写的多图上传带进度条插件。完整项目打包上传,绝对可运行。
Extjs4 swfupload 多文件上传
Extjs4 swfupload 多文件 上传


