/css/ext-all.css"/>

亚洲免费在线-亚洲免费在线播放-亚洲免费在线观看-亚洲免费在线观看视频-亚洲免费在线看-亚洲免费在线视频

Ext.ux.UploadDialog.Dialog Ext上傳

系統 2578 0
今天做項目做了個上傳的功能,不過遇到好多問題,先在這做個筆記。。。。

先引入
Java代碼 復制代碼 ? 收藏代碼
  1. ???<link?rel= "stylesheet" ?type= "text/css" ?href= "<%=path?%>/css/ext-all.css" ?/> ??
  2. <!--?GC?--> ??
  3. <!--?LIBS?--> ??
  4. <script?type= "text/javascript" ?src= "<%=path?%>/js/ext-base.js" ></script> ??
  5. <!--?ENDLIBS?--> ??
  6. <script?type= "text/javascript" ?src= "<%=path?%>/js/ext-all.js" ></script> ??
  7. <script?type= "text/javascript" ?src= "<%=path?%>/js/ext-lang-zh_CN.js" ></script> ??
  8. ???? ??
  9. <script?type= "text/javascript" ?src= "<%=path?%>/js/UploadDialog/Ext.ux.UploadDialog.js" ></script> ??
  10. ???? ??
  11. <script?type= "text/javascript" ?src= "<%=path?%>/js/UploadDialog/Ext.ux.UploadDialog.packed.js" ></script>??
          <link rel="stylesheet" type="text/css" href="<%=path %>/css/ext-all.css" />
	<!-- GC -->
	<!-- LIBS -->
	<script type="text/javascript" src="<%=path %>/js/ext-base.js"></script>
	<!-- ENDLIBS -->
	<script type="text/javascript" src="<%=path %>/js/ext-all.js"></script>
	<script type="text/javascript" src="<%=path %>/js/ext-lang-zh_CN.js"></script>
		
	<script type="text/javascript" src="<%=path %>/js/UploadDialog/Ext.ux.UploadDialog.js"></script>
		
	<script type="text/javascript" src="<%=path %>/js/UploadDialog/Ext.ux.UploadDialog.packed.js"></script>

    


Ext代碼:
Java代碼 復制代碼 ? 收藏代碼
  1. ??? /** ?
  2. ????*? 文件上傳 ?
  3. ????*/ ??
  4. ???function?insertImages()? ??
  5. {? ??
  6. ????var?editId=Ext.getCmp( 'queId' ).getValue(); ??
  7. ???? //alert('../files.do?method=addFile&type=ntc&tmpId='+useId+'&isupdate='+isupdate+'&editId='+editId); ??
  8. ????dialog?=? new ?Ext.ux.UploadDialog.Dialog({? ??
  9. ??????????title:? ' 文件上傳 ' ,?? ??
  10. ??????????url:paths+ '/files.do?method=addFile&type=que&tmpId=' +useId+ '&isupdate=' +isupdate+ '&editId=' +editId,?? ??
  11. ??????????width?:? 450 ,? ??
  12. ??????????height?:? 300 ,? ??
  13. ??????????minWidth?:? 450 ,? ??
  14. ??????????minHeight?:? 300 ,? ??
  15. ??????????draggable?:? true ,? ??
  16. ??????????resizable?:? true ,? ??
  17. ?????????? //autoCreate:?true,???? ??
  18. ??????????constraintoviewport:? true ,?? ??
  19. ??????????permitted_extensions:[ 'ZIP' , 'zip' , 'DOC' , 'doc' , 'XLS' , 'xls' , 'TXT' , 'txt' , 'RAR' , 'rar' , 'JPG' , 'jpg' , 'GIF' , 'gif' , 'PNG' , 'png' ],???? ??
  20. ??????????modal:? true ,? ??
  21. ?????????? //post_var_name:?'mms',? ??
  22. ??????????post_var_name:? 'upload' ,? ??
  23. ??????????reset_on_hide:? false ,?? ??
  24. ??????????allow_close_on_upload:? true ,??? //關閉上傳窗口是否仍然上傳文件? ??
  25. ??????????upload_autostart:? true ??? ??
  26. ????});? ??
  27. ????dialog.show(); //'show-button'? ??
  28. ????dialog.on( 'uploadsuccess' ,?onUploadSuccess);? ??
  29. }? ??
  30. ??
  31. ??
  32. function?onUploadSuccess(dialog,?filename,?resp_data,?record){??? ??
  33. ????????????????var?queId= '' ; ??
  34. ???????????????? if (isupdate== 1 ) ??
  35. ????????????????????queId=useId; ??
  36. ???????????????? if (isupdate== 2 ) ??
  37. ????????????????????queId=Ext.getCmp( 'queId' ).getValue(); ??
  38. ????????????????fileDs.load({ ??
  39. ????????????????????params:?{ ??
  40. ????????????????????????findId:?queId, ??
  41. ????????????????????????type: 'que' , ??
  42. ????????????????????????isupdate:isupdate ??
  43. ????????????????????????????} ??
  44. ????????????????}); ??
  45. }??
          /**
     * 
      
        文件上傳
      
      
     */
    function insertImages() 
	{ 
		var editId=Ext.getCmp('queId').getValue();
		//alert('../files.do?method=addFile&type=ntc&tmpId='+useId+'&isupdate='+isupdate+'&editId='+editId);
    	dialog = new Ext.ux.UploadDialog.Dialog({ 
	          title: '
      
        文件上傳
      
      ',  
	          url:paths+'/files.do?method=addFile&type=que&tmpId='+useId+'&isupdate='+isupdate+'&editId='+editId,  
	          width : 450, 
	          height : 300, 
	          minWidth : 450, 
	          minHeight : 300, 
	          draggable : true, 
	          resizable : true, 
	          //autoCreate: true,    
	          constraintoviewport: true,  
	          permitted_extensions:['ZIP','zip','DOC','doc','XLS','xls','TXT','txt','RAR','rar','JPG','jpg','GIF','gif','PNG','png'],    
	          modal: true, 
	          //post_var_name: 'mms', 
	          post_var_name: 'upload', 
	          reset_on_hide: false,  
	          allow_close_on_upload: true,   //關閉上傳窗口是否仍然上傳文件 
	          upload_autostart: true   
	    }); 
    	dialog.show();//'show-button' 
    	dialog.on('uploadsuccess', onUploadSuccess); 
	} 


	function onUploadSuccess(dialog, filename, resp_data, record){   
	  				var queId='';
					if(isupdate==1)
						queId=useId;
					if(isupdate==2)
						queId=Ext.getCmp('queId').getValue();
					fileDs.load({
						params: {
							findId: queId,
							type:'que',
							isupdate:isupdate
								}
					});
	}

    


Ext.ux.UploadDialog中的其它事件函數[轉載自http://wayfoon.iteye.com/blog/432541]
??? * filetest - fires before file is added into the queue, parameters:
????? dialog - reference to dialog
????? filename - file name
????? If handler returns false then file will not be queued.
??? * fileadd - fires when file is added into the queue, parameters:
????? dialog - reference to dialog
????? filename - file name
??? * fileremove - fires when file is removed from the queue, parameters:
????? dialog - reference to dialog
????? filename - file name
????? record - file record
??? * resetqueue - fires when upload queue is resetted, parameters:
????? dialog - reference to dialog
??? * beforefileuploadstart - fires when file as about to start uploading:
????? dialog - reference to dialog
????? filename - uploaded file name
????? record - file record
????? If handler returns false then file upload will be canceled.
??? * fileuploadstart - fires when file has started uploading:
????? dialog - reference to dialog
????? filename - uploaded file name
????? record - file record
??? * uploadsuccess - fires when file is successfuly uploaded, parameters:
????? dialog - reference to dialog
????? filename - uploaded file name
????? data - js-object builded from json-data returned from upload handler response.
????? record - file record
??? * uploaderror - fires when file upload error occured, parameters:
????? dialog - reference to dialog
????? filename - uploaded file name
????? data - js-object builded from json-data returned from upload handler response.
????? record - file record
??? * uploadfailed - fires when file upload failed, parameters:
????? dialog - reference to dialog
????? filename - failed file name
????? record - file record
??? * uploadcanceled - fires when file upload canceled, parameters:
????? dialog - reference to dialog
????? filename - failed file name
????? record - file record
??? * uploadstart - fires when upload process starts, parameters:
????? dialog - reference to dialog
??? * uploadstop - fires when upload process stops, parameters:
????? dialog - reference to dialog
??? * uploadcomplete - fires when upload process complete (no files to upload left), parameters:
????? dialog - reference to dialog

Ext.ux.UploadDialog.Dialog Ext上傳


更多文章、技術交流、商務合作、聯系博主

微信掃碼或搜索:z360901061

微信掃一掃加我為好友

QQ號聯系: 360901061

您的支持是博主寫作最大的動力,如果您喜歡我的文章,感覺我的文章對您有幫助,請用微信掃描下面二維碼支持博主2元、5元、10元、20元等您想捐的金額吧,狠狠點擊下面給點支持吧,站長非常感激您!手機微信長按不能支付解決辦法:請將微信支付二維碼保存到相冊,切換到微信,然后點擊微信右上角掃一掃功能,選擇支付二維碼完成支付。

【本文對您有幫助就好】

您的支持是博主寫作最大的動力,如果您喜歡我的文章,感覺我的文章對您有幫助,請用微信掃描上面二維碼支持博主2元、5元、10元、自定義金額等您想捐的金額吧,站長會非常 感謝您的哦!!!

發表我的評論
最新評論 總共0條評論
主站蜘蛛池模板: 日韩在线视频一区二区三区 | 高清影院|精品秒播3 | 久久视精品 | 国产第二区 | 欧美末成年videos在线观看 | 天天艹 | 国产欧美日韩精品高清二区综合区 | 97se亚洲 | 狠狠干夜夜 | 久久青草国产免费观看 | 成人a毛片视频免费看 | 97久久曰曰久久久 | 亚洲精品第一页中文字幕 | 国产一区二区亚洲精品 | 久久久中文字幕日本 | 日韩欧美亚洲精品 | 天天看片日日夜夜 | 成年女人18级毛片毛片免费观看 | 国产精品麻豆一区二区 | 欧美激情综合亚洲一二区 | 亚洲欧美日韩精品高清 | 黄色免费观看视频网站 | 久久国产香蕉 | 国产精品国语自产拍在线观看 | 成人特级毛片69免费观看 | 性www | 伊人精品影院一本到欧美 | 久草视频在线播放 | 久久精品国产精品亚洲红杏 | 久久国产免费一区 | 亚洲精品一区henhen色 | 91在线精品 | 夜夜夜夜夜操 | 污视频在线看网站 | 99久久精彩视频 | 欧美毛片aaaaa片久久久久 | 色综合社区 | 日韩在线观看中文字幕 | www四虎影视| 久久亚洲精品一区二区三区浴池 | 国产99在线视频 |