+ -
当前位置:首页 → 问答吧 → ext3.0+struts2.0 在上传图片成功后,把图片保存在项目中,如果要修改时,怎么把上传后的图片显示出来??

ext3.0+struts2.0 在上传图片成功后,把图片保存在项目中,如果要修改时,怎么把上传后的图片显示出来??

时间:2011-09-24

来源:互联网

我的页面上的部分代码:
  items:[
  {
  fieldLabel:'员工照片',
  xtype : 'box',
  height:157,
  id : 'browseImage',
  style :'background-color:#BDB76B',
  autoEl :{
  width : 150, 
  height : 150, 
  tag : 'img', 
  src : Ext.BLANK_IMAGE_URL,
  style : 'filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(sizingMethod=scale);', 
  complete : 'off', 
  id : 'imageBrowse'
  }  
  },{
  fieldLabel:'浏览照片',
  xtype : 'fileuploadfield',
  id : "upload",  
  name : "upload", 
  anchor : "90%",
emptyText: '点击按钮上传图片',
buttonText : "浏览",
allowBlank : true,
listeners : {
'fileselected': function(field, newValue, oldValue) {
var url = 'file:///'+Ext.get('upload').dom.value;  
if (img_reg.test(url)) {
if (Ext.isIE6) {
var image = top.Ext.get('imageBrowse').dom;
image.src = url;
} else if (Ext.isIE8 || Ext.isIE7) {
var image = top.Ext.get('imageBrowse').dom;
image.filters.item("DXImageTransform.Microsoft.AlphaImageLoader").src = url;
} else {
top.Ext.get('imageBrowse').dom.src = getFullPath(top.Ext.get('upload').dom);
}
}  
}
}
  }]

作者: xuloveshan   发布时间: 2011-09-24

你可以firebug看这个组件的图片对应的img的id 为其附src值就是了

作者: fanchuanzhidu   发布时间: 2011-09-25

相关阅读 更多

热门下载

更多