0
我使用Grid面板。当我选择在网格中的行我得到如下结果:ExtJS弹出窗口窗体数据加载
- 如果我呈现的形式,“document.body的”一切正常,并形成 字段填写。
- 如果我在窗口面板中启动了相同的窗体,则表单字段为空。
- 当我同时使用时,在'document.body'中呈现的表格被关闭,并且窗口中的表单字段被填充。
我在哪里犯错。
// Grip panel part
sm: new Ext.grid.RowSelectionModel({
singleSelect: true,
listeners: {
rowselect: function(sm, index, record) {deleteWindow.show();}
}
})
// End Grid panel part
var myForm = new Ext.form.FormPanel({
title:"Basic Form",
width:425,
frame:true,
items: [
new Ext.form.TextField({
id:"to",
fieldLabel:"To",
width:275,
allowBlank:false,
blankText:"Please enter a to address",
readOnly: true
}),
new Ext.form.TextField({
id:"subject",
fieldLabel:"Subject",
width:275,
allowBlank:false,
blankText:"Please enter a subject address",
readOnly: true
}),
],
buttons: [
{text:"Cancel"},
{text:"Save"}
]
});
var deleteWindow = new Ext.Window({
id: 'id_deleteWindow',
title: 'Delete',
closable:true,
width: 750,
height: 380,
plain:true,
layout: 'fit',
items: myForm
});
var id_test = 2; // This is only for this problem
//myForm.render(document.body); // When using this code everything is ok, and form fields are filled
myForm.getForm().load({
url:'ggg.php',
params:{
id: id_test
}
});
JSON数据
{success:true,results:[{"id_test":"1","to":"a","subject":"aa"}]}