Javascript Ext.Window在显示时窃取表单元素,并且不';藏不起来

Javascript Ext.Window在显示时窃取表单元素,并且不';藏不起来,javascript,forms,extjs,Javascript,Forms,Extjs,我有如下类似的HTML <html> <form action='action.php'> <input type="hidden" name="id" value="10" /> <div id="inputs"> <input type="text" name="firstName" /><br/> <input typ

我有如下类似的HTML

<html>
    <form action='action.php'>

       <input type="hidden" name="id" value="10" />

       <div id="inputs">
              <input type="text" name="firstName" /><br/>
              <input type="text" name="lastName" />
        </div>
    </form>
</html>
调用
inputDialog.show()
时,将根据需要在窗口中显示输入。但实际情况是,
#inputs
div脱离了要在窗口中显示的表单。DOM变成如下所示

        var inputDialog = new Ext.Window({
               title: 'Inputs',
               id:'InputsDialog',        
               contentEl: 'inputs'
        });
<html>
    <form action='action.php'>
       <input type="hidden" name="id" value="10" />
    </form>

    <script> 
         <!-- Some Ext.Window related script appears here-->
    </script>


    <div id="InputsDialog">
         <!-- Lots of Ext.Window specific HTML -->
         <div id="inputs">
              <input type="text" name="firstName" /><br/>
              <input type="text" name="lastName" />
        </div>
    </div>
</html>


调用
inputDialog.hide()
时,窗口消失,但DOM保持原样,
#input
div不会返回表单。因此;提交表单时,仅提交隐藏字段


是否有可以还原DOM的配置?

我认为没有参数可以让您自动将div还原回文档。您始终可以使用vanilla Javascript为您做到这一点:

var inputDialog=新建外部窗口({
标题:“投入”,
id:'InputsDialog',
contentEl:'输入',
听众:{
隐藏:函数(){
var div=document.getElementById('inputs');
var form=document.getElementById('the-form-id');
表格.附属儿童(div);;
}
}
});

您是在调用
关闭
而不是
隐藏
。这也许可以解释你的行为。