var win = Ext.create('Ext.Window',{
width:800,
height:600,
x:50,
y:50,
plain: true,
//指示标题头的位置,分别为 top,bottom,left,right,默认为top
headerPosition: 'top',
layout: {
type: 'table',
columns: 1
},
title: '图片浏览',
defaults:{frame:true,width:400,height:100},
items:[{title:'', html: '<img width="780" height="580" src="<%=basePath%>goodsimages/'+AGoodsID+'.jpg"/>', rowspan: 1 ,height:800,width:600}]
});
win.show();
//目前不知道要怎么传入参数AGoodsID
//请高手们不吝赐教!谢谢!
width:800,
height:600,
x:50,
y:50,
plain: true,
//指示标题头的位置,分别为 top,bottom,left,right,默认为top
headerPosition: 'top',
layout: {
type: 'table',
columns: 1
},
title: '图片浏览',
defaults:{frame:true,width:400,height:100},
items:[{title:'', html: '<img width="780" height="580" src="<%=basePath%>goodsimages/'+AGoodsID+'.jpg"/>', rowspan: 1 ,height:800,width:600}]
});
win.show();
//目前不知道要怎么传入参数AGoodsID
//请高手们不吝赐教!谢谢!
应该先定义一个窗体对象"Ext.define("Golden.TestWindow",{});",在里面定义属性和方法:
Ext.define("Golden.TestWindow",{
AGoodsID :'',
getAGoodsID:function(){
return this.AGoodsID;
},
setAGoodsID:function(agi){
this.AGoodsID=agi;
},
createWindow:function(){
var win = Ext.create('Ext.Window',{
width:800,
height:600,
x:50,
y:50,
plain: true,
//指示标题头的位置,分别为 top,bottom,left,right,默认为top
headerPosition: 'top',
layout: {
type: 'table',
columns: 1
},
title: '图片浏览',
defaults:{frame:true,width:400,height:100},
items:[{title:'', html: '<img width="780" height="580" src="<%=basePath%>goodsimages/'+this.AGoodsID+'.jpg"/>', rowspan: 1 ,height:800,width:600}]
});
win.show();
}
});
使用时实例化这个类,调用createWindow()前先调用setAGoodsID('xxxx')即可。
大致如此了,可能代码得调一下,随手打的,未经测试,但是解决方案和规范便是如此了。
不过现在还是遇到一个问题,就是AGoodsID是数字型的则可以正常调出图片,如果图片名称包含有字母,则不能正常显示图片!
请问这个问题该如何处理啊?!!
谢谢啦!