日期:2014-05-16  浏览次数:20388 次

Extjs学习手记-文件上传插件
效果:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
 <head>
  <title> 我的ext测试页面-上传 </title>
  <Meta http-equiv="Content-Type" Content="text/html; Charset=utf-8">
    <link rel="stylesheet" type="text/css" href="../ext/resources/css/ext-all.css"/>
	<script type="text/javascript" src="../ext/adapter/ext/ext-base-debug.js"></script>
    <script type="text/javascript" src="../ext/ext-all-debug.js"></script>
	<script type="text/javascript" src="../ext/src/locale/ext-lang-zh_CN.js"></script>

	<script type="text/javascript" src="../ext/ux/filemgr/Ext.ux.UploadDialog/Ext.ux.UploadDialog.js"></script>
	<link rel="stylesheet" type="text/css" href="../ext/ux/filemgr/Ext.ux.UploadDialog/Ext.ux.UploadDialog.css"/>

 </head>

<script type="text/javascript">
	Ext.BLANK_IMAGE_URL = '../ext/resources/images/default/s.gif';
</script>
<script type="text/javascript">
	var dialog;
	Ext.onReady(function(){
		Ext.QuickTips.init();

		dialog = new Ext.ux.UploadDialog.Dialog({
			url:'',
			reset_on_hide:false,//是否在窗口隐藏时清空表格中的文件
			allow_close_on_upload:true,//是否在关闭窗口时进行上传
			upload_autostart:false//是否用户选择一个文件就马上上传
		});
		//dialog.show("upload_btn");
	});

	function show(){
		dialog.show();
	}
</script>
 <body>
  <INPUT id="upload_btn" TYPE="button" VALUE="上传" onclick="show();"/>
 </body>
</html>