如何使已经new过的panel重新刷新、构造??代码如下所示:当我用getCmp获取到fileStampPanel 的对象后,改变这个对象的属性, this.stampState=stampState;
this.stampUserName=stampUserName;
this.imageName 值改变后,我打算让panel重新生成一次,注意不是重新new,好刷新panel达到我想要的目的,但是panel的render等方法都不好用,有什么办法么???
JDAN.FactureManage.fileStampPanel = function(stampState,stampUserName){
//默认属性
this.stampState=stampState;
this.stampUserName=stampUserName;
this.imageName = this.stampState==true?'stampbgimageGreen.gif':'stampbgimage.gif';
JDAN.FactureManage.fileStampPanel.superclass.constructor.call(this, {
id:'fileStampPanel',
title : '签章信息',
height : 120,
iconCls : 'icn2Mam',
bodyStyle : 'background-image:url(../FactureManage/Images/'+this.imageName+');line-height:60px;',// 加背景图片并使文字居中
html : '<center><font size=6 color=white style="FONT-FAMILY: 隶书">'
+ this.stampUserName + '</font></center>',
tbar : [{
text : '签章',
tooltip : '文件确认签章',
scope : this,
iconCls : 'icnRefresh',
handler : this.onBtnStamp
}]
})
};
Ext.extend(JDAN.FactureManage.fileStampPanel, Ext.Panel, {
onBtnStamp:function(){
var stampWin = new JDAN.FactureManage.ProgramStampWin();
stampWin.show();
//Ext.MessageBox.alert('提示','对图片进行签章确认!');
}
});
解决方案 »
- 请教EasyUI框架?
- 急!急!急! 如何在公共函数里获取showModalDialog的返回值
- <input type="button" value="动态" onclick="add()" />出错···
- 有谁遇到这样的问题!
- 求不能输入" ' " (单引号)和 " & "这两个特殊字符的正则表达式
- 页面提示有错,不知错在何处.
- alert 小问题!
- 如何判断一个字符串是否是数值(等价于vb中的isnumeric(SomeString)?)
- 用什么函数判断一个字符传中包含另一个字符串?谢谢!
- EXTJS 自定义排序问题
- **解决JavaScript 内存释放及OOP编程问题**
- 请问JS、jquery可以直接改变原始的HTML文件么?
Ext.extend(Ext.JDAN.FactureManage.fileStampPanel, Ext.Panel, {
onBtnStamp:function(){
this.imageName = 'xxxx.jpg';//image you going to change
this.stampUserName = 'hello world';//text you going to fill
var body = Ext.getDom(this.body);
body.style.cssText = 'background-image:url('+this.imageName+');line-height:60px;';
body.innerHTML = ' <center> <font">'+ this.stampUserName + ' </font> </center>'
//Ext.MessageBox.alert('提示','对图片进行签章确认!');
}
});