一个列表GridPanel,里面是一些员工的信息,点击查看或修改的时候,会有一个FormPanel显示出来,FormPanel里面会有一个或多个Panel用来显示员工的照片或其他图片。
现在我是这样做的,GridPanel上的sm加一个listeners,selectionchange的时候其中一个PhotoPanel这样操作如下var sm = new Ext.grid.CheckboxSelectionModel({
listeners:{
selectionchange:function combovalue()
{
if(sm.getCount()!=0)
{
GROUPID=sm.getSelected().get('groupId');
//FrontPhoto.load({html:"<img src='FrontPhotoAction?groupid="+GROUPID+"'">});
//FrontPhoto.html ="<img src='FrontPhotoAction?groupid="+GROUPID+"'>";
//FrontPhoto.load();
//FrontPhoto.load({url:'FrontPhotoAction?groupid='+GROUPID});
//以上的都不行
……………………
下面这2个网上说的比较多,用load
FrontPhoto.load({url:'FrontPhotoAction?groupid='+GROUPID});
FrontPhoto.load({html:"<img src='FrontPhotoAction?groupid="+GROUPID+"'">});
但这样会提示 无效的过程调用或参数
请高手指教怎么实现这个功能
现在我是这样做的,GridPanel上的sm加一个listeners,selectionchange的时候其中一个PhotoPanel这样操作如下var sm = new Ext.grid.CheckboxSelectionModel({
listeners:{
selectionchange:function combovalue()
{
if(sm.getCount()!=0)
{
GROUPID=sm.getSelected().get('groupId');
//FrontPhoto.load({html:"<img src='FrontPhotoAction?groupid="+GROUPID+"'">});
//FrontPhoto.html ="<img src='FrontPhotoAction?groupid="+GROUPID+"'>";
//FrontPhoto.load();
//FrontPhoto.load({url:'FrontPhotoAction?groupid='+GROUPID});
//以上的都不行
……………………
下面这2个网上说的比较多,用load
FrontPhoto.load({url:'FrontPhotoAction?groupid='+GROUPID});
FrontPhoto.load({html:"<img src='FrontPhotoAction?groupid="+GROUPID+"'">});
但这样会提示 无效的过程调用或参数
请高手指教怎么实现这个功能
url::'必须是一个页面eg:jsp/php/...'
//}
1、为panel设置背景样式,icon,iconCls也是可以的
2、html: "<iframe src='a.html'/>" a.html显示一张图片
3、为panel添加一个Filed,设置inputType: "image"
var panel = new Ext.Panel({
title: "图片"
items: [{
xtype: "field",
inputType: "image"//这个是关键,还没有完
}],
listeners: {
"beforerender": function () {//也可以用beforeshow事件
var imgField = this.items.itemAt(0);
imgField.getEl().dom.src = "img.jpg";//注意路径
}
}
});
/*or panel.items.itemAt(0).getEl().dom.src = "img.jpg";*/
4、用DomHelper动态创建dom标签img建议用第三种方法
var panel = new Ext.Panel({
title: "图片"
items: [{
xtype: "field",
inputType: "image"//这个是关键,还没有完
}],
listeners: {
"beforerender": function () {//也可以用beforeshow事件
var imgField = this.items.itemAt(0);
imgField.getEl().dom.src = "yourActin.actoin";//注意路径
}
}
});
/*or panel.items.itemAt(0).getEl().dom.src = "yourActin.actoin";*/
将地址改成action即可
我把panel放到一个window里面,点“修改”按钮 window就显示出来,这时候会进到action读取,之后点击window右上角的“X”关掉window,当把action修改了之后再点“修改”按钮,window.show(),这时候不会再去scr里的新的action里读取了!