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"}]}