Steve_Chen_LI 2015-08-13 08:43 采纳率: 56.3%
浏览 1460

Ext 显示图片相关的问题

这是通过 数组形式显示

 function showDefaultImg_org_edit() {
        debugger;
        var imageUrls = [ "identiImgUrl_org_edit", "identibackImgUrl_org_edit",
                "identiImgUrl2_org_edit", "cardImgUrl_org_edit", "cardImgUrl2_org_edit",
                "licenseImgUrl_org_edit", "taxLicenseImgUrl_org_edit", "orgLicenseUrl_org_edit",
                "openProveImgUrl_org_edit", ];
        var len = imageUrls.length;
        for (var i = 0; i < len; i++) {
            var imageurl = imageUrls[i];
            var imgFile = imageurl + "File";
            var imgpath = addForm_org_edit.getForm().findField(imageurl).getValue();
            if (imgpath == "" || imgpath == null) {
                imgpath = default_img;
            }
            Ext.getCmp(imgpath).setSrc(imageurl);
            addForm_org_edit.getForm().findField(imgFile).allowBlank = true;
        }
    }

这是单独进行显示

            Ext.getCmp("identiImgUrl_org_edit").setSrc(record2.data.identiImgUrl);
             Ext.getCmp("identibackImgUrl_org_edit").setSrc(record2.data.identibackImgUrl);
             Ext.getCmp("identiImgUrl2_org_edit").setSrc(record2.data.identiImgUrl2);
             Ext.getCmp("cardImgUrl_org_edit").setSrc(record2.data.cardImgUrl);
         Ext.getCmp("cardImgUrl2_org_edit").setSrc(record2.data.cardImgUrl2);
             Ext.getCmp("licenseImgUrl_org_edit").setSrc(record2.data.licenseImgUrl);
             Ext.getCmp("taxLicenseImgUrl_org_edit").setSrc(record2.data.taxLicenseImgUrl);
             Ext.getCmp("orgLicenseUrl_org_edit").setSrc(record2.data.orgLicenseUrl);
         Ext.getCmp("openProveImgUrl_org_edit").setSrc(record2.data.openProveImgUrl);

单独进行显示是正常的,
但是 以数组的形式进行显示时,会报错,报错如下。
检查了数据库,图片已经保存。

 Uncaught TypeError: Cannot call method 'getValue' of null
  • 写回答

1条回答 默认 最新

  • devmiao 2015-08-13 23:12
    关注
    评论

报告相同问题?

悬赏问题

  • ¥20 有关区间dp的问题求解
  • ¥15 多电路系统共用电源的串扰问题
  • ¥15 slam rangenet++配置
  • ¥15 有没有研究水声通信方面的帮我改俩matlab代码
  • ¥15 对于相关问题的求解与代码
  • ¥15 ubuntu子系统密码忘记
  • ¥15 信号傅里叶变换在matlab上遇到的小问题请求帮助
  • ¥15 保护模式-系统加载-段寄存器
  • ¥15 电脑桌面设定一个区域禁止鼠标操作
  • ¥15 求NPF226060磁芯的详细资料