WINDOW动态改变高度与长度



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 = '

', tableend = '
';

  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 + '' + moreInfo.msg1
       + '' + 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
               + '详细信息错误返回时间:'
               + moreInfo.tiem
               + '
'
               + moreInfo.msg2
               + '
'
               + moreInfo.msg1
               + ''
               + tableend);
          } else {
           obj.setText('显示详细信息');
           err_window.setPosition(
             restorePos[0],
             restorePos[1]);
           err_window.setSize(
             restoreSize.width,
             restoreSize.height);
           err_window.update(tabtitle
             + ''
             + moreInfo.msg1
             + '' + 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);

你可能感兴趣的:(前端,EXT,eclipse)