var restoreSize = {};
var restorePos = [];
errInfo = errArr[errArr.length - 1];
if (errInfo == null || "" == errInfo) {
errInfo = errArr[errArr.length - 2];
}
moreInfo.errtype = '002';
moreInfo.msg1 = errInfo;
moreInfo.tiem = errArr[0];
moreInfo.code = errArr[1];
moreInfo.msg2 = errArr[2];
var tabtitle = '<table width="100%" height="100%" style="font-size:12px;">', tableend = '</table>';
var err_window = new Ext.Window(
{
autoCreate : true,
resizable : false,
constrain : true,
constrainHeader : true,
minimizable : false,
maximizable : false,
stateful : false,
modal : true,
shim : true,
minHeight : 120,
plain : true,
footer : true,
closable : true,
autoScroll : true,
title : title,
width : 500,
height : 150,
html : tabtitle + '<tr><td >' + moreInfo.msg1
+ '</td></tr>' + tableend,
bbar : new Ext.Toolbar(
{
buttonAlign : "right",
items : [ {
text : '显示详细信息',
handler : function(obj) {
if (obj.text == '显示详细信息') {
obj.setText('收起详细信息');
err_window.setPosition(
restorePos[0],
restorePos[1] - 30);
err_window.setSize(
restoreSize.width,
restoreSize.height + 70);
err_window
.update(tabtitle
+ '<tr align="center" height="20%"><td>详细信息</td></tr><tr><td>错误返回时间:'
+ moreInfo.tiem
+ '</br>'
+ moreInfo.msg2
+ '</br>'
+ moreInfo.msg1
+ '</td></tr>'
+ tableend);
} else {
obj.setText('显示详细信息');
err_window.setPosition(
restorePos[0],
restorePos[1]);
err_window.setSize(
restoreSize.width,
restoreSize.height);
err_window.update(tabtitle
+ '<tr><td >'
+ moreInfo.msg1
+ '</td></tr>' + tableend);
}
}
} ]
}),
buttonAlign : "center",
buttons : [ {
text : "确认",
handler : function() {
if (failAction) {
failAction(retobj);
}
err_window.close();
}
} ]
});
err_window.show();
restoreSize = err_window.getSize();
restorePos = err_window.getPosition(true);
主要代码:
err_window.setPosition( restorePos[0], restorePos[1]);
err_window.setSize( restoreSize.width, restoreSize.height);