zoukankan      html  css  js  c++  java
  • EXTjs上传文件上传控件

    View Code
     1 Ext.onReady(function(){
     2     var fileUpload = new Ext.FormPanel({ 
     3         id:'fileUpload',
     4         frame:true,
     5         fileUpload:true,
     6         items:[{
     7                     xtype:'textfield',
     8                     labelStyle : 'text-align:right;',
     9                     allowBlank:false,
    10                     fieldLabel:'选择文件',
    11                     inputType:'file',
    12                     name:'fileName',
    13                     200
    14                 }
    15           ],
    16           buttonAlign:'center',
    17           buttons:[{
    18                   text:'上传',
    19                 handler:function(){
    20                         if(fileUpload.form.isValid()){
    21                             fileUpload.form.submit({
    22                                 method:'post',
    23                                 url:'DefaultUrl',//根据自己系统的需要调用程序处理上传文件
    24                                 waitMsg:'文件上传中...',
    25                                 success: function() {
    26                                     Ext.Msg.alert("系统提示", "文件上传成功!");
    27                                 },
    28                                 failure: function() {
    29                                     Ext.Msg.alert("系统提示", "文件上传失败!");
    30                                 }
    31                             });
    32                         }else{
    33                             Ext.Msg.alert("系统提示","请选择文件后再上传!");
    34                         }
    35                     }
    36                 },{
    37                     text:'取消',
    38                     handler:function(){
    39                         winFielUpload.hide();
    40                     }
    41                 }
    42          ]
    43     });
    44     var winFielUpload=new Ext.Window({
    45         id:'win',
    46         title:'文件上传',
    47         //****renderTo:'divWindow',//对于window不要使用renderTo属性,只需要调用show方法就可以显示,添加此属性会难以控制其位置
    48         350,
    49         closeAction:'hide',//close缺省的动作是从DOM树中移除window并彻底加以销毁, hide隐藏
    50         height:105,
    51         layout:'fit',
    52         autoDestory:true,
    53         modal:true,
    54         closeAction:'hide',
    55         items:[
    56             fileUpload
    57         ]
    58     }).show();
    59 });
  • 相关阅读:
    xilinx下载器,JTAG-HS3和Platform Cable USB II 速度对比
    LATTICE下载器HW-USBN-2B使用说明
    altera下载器高速版本 PL-USB2-BLASTER 使用说明
    FPGA流程设计
    关于fpga的后仿真重要性
    使用MyBatis分页插件PageHelper遇到的问题
    java 面试题总结01
    netty Demo
    netty 概念篇
    pom.xml 简述
  • 原文地址:https://www.cnblogs.com/huxiaowei/p/3148520.html
Copyright © 2011-2022 走看看