• 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 });
  • 相关阅读:
    nginx-1.8.1的安装
    ElasticSearch 在3节点集群的启动
    The type java.lang.CharSequence cannot be resolved. It is indirectly referenced from required .class files
    sqoop导入导出对mysql再带数据库test能跑通用户自己建立的数据库则不行
    LeetCode 501. Find Mode in Binary Search Tree (找到二叉搜索树的众数)
    LeetCode 437. Path Sum III (路径之和之三)
    LeetCode 404. Sum of Left Leaves (左子叶之和)
    LeetCode 257. Binary Tree Paths (二叉树路径)
    LeetCode Questions List (LeetCode 问题列表)- Java Solutions
    LeetCode 561. Array Partition I (数组分隔之一)
  • 原文地址:https://www.cnblogs.com/huxiaowei/p/3148520.html
Copyright © 2020-2023  润新知