zoukankan      html  css  js  c++  java
  • extjs 文件上传对话框显示后,页面出现空白的问题

    extjs 文件上传对话框显示后,页面出现空白的,之前的写法是整个panel用Ext.form.panel,

    修改为只有文件上传部分的控件用ext.form.panel包含,整个页面用Ext.panel.panel包含,

    可以避免这个问题。


     1 Ext.define('MyApp.view.MyPanel', {
     2     extend: 'Ext.panel.Panel',
     3 
     4     height: 375,
     5      557,
     6     layout: {
     7         type: 'border'
     8     },
     9     title: 'My Panel',
    10 
    11     initComponent: function() {
    12         var me = this;
    13 
    14         Ext.applyIf(me, {
    15             items: [
    16                 {
    17                     xtype: 'gridpanel',
    18                     title: 'My Grid Panel',
    19                     region: 'center',
    20                     columns: [
    21                         {
    22                             xtype: 'gridcolumn',
    23                             dataIndex: 'string',
    24                             text: 'String'
    25                         },
    26                         {
    27                             xtype: 'numbercolumn',
    28                             dataIndex: 'number',
    29                             text: 'Number'
    30                         },
    31                         {
    32                             xtype: 'datecolumn',
    33                             dataIndex: 'date',
    34                             text: 'Date'
    35                         },
    36                         {
    37                             xtype: 'booleancolumn',
    38                             dataIndex: 'bool',
    39                             text: 'Boolean'
    40                         }
    41                     ],
    42                     viewConfig: {
    43 
    44                     }
    45                 },
    46                 {
    47                     xtype: 'container',
    48                     height: 110,
    49                     layout: {
    50                         type: 'border'
    51                     },
    52                     region: 'north',
    53                     items: [
    54                         {
    55                             xtype: 'form',
    56                             bodyPadding: 10,
    57                             title: '',
    58                             region: 'center',
    59                             items: [
    60                                 {
    61                                     xtype: 'filefield',
    62 id:'upfile',//需要通过ID,获得控件的form,在执行提交动作
    63                                      534,
    64                                     fieldLabel: 'Label',
    65                                     anchor: '100%'
    66                                 },
    67                                 {
    68                                     xtype: 'button',
    69                                     text: 'MyButton'
    70                                 }
    71                             ]
    72                         }
    73                     ]
    74                 }
    75             ]
    76         });
    77 
    78         me.callParent(arguments);
    79     }
    80 
    81 });

    Ext.getCmp('upfile').getForm().submit({   
                waitTitle : '系统提示',
                waitMsg : '正在上传,请等待...',// 动作发生期间显示的文本信息
                url: 'Fileupload.aspx',//fileUploadServlet   
                method : 'POST',// 表单提交方式
                params : request,
                success: onSuccess,
                failure: onFailure
        });   
     

  • 相关阅读:
    云图说 | GPU共享型AI容器,让AI开发更普及
    手把手带你写Node.JS版本小游戏
    一个银行客户经理的“变形记”
    大厂运维必备技能:PB级数据仓库性能调优
    软件工程开发之道:了解能力和复杂度是前提
    大数据管理:构建数据自己的“独门独院”
    结构体与共用体05 零基础入门学习C语言57
    结构体与共用体04 零基础入门学习C语言56
    PE格式详细讲解1 系统篇01|解密系列
    初步认识PE格式 基础篇06|解密系列
  • 原文地址:https://www.cnblogs.com/baishahe/p/2545326.html
Copyright © 2011-2022 走看看