격자 패널을 사용합니다. 나는 그리드에서 행을 선택하면 나는 다음과 같은 결과를 얻을 : 나는 '는 document.body'모든 일에 양식을 렌더링하는 경우ExtJS 팝업 창 양식 데이터로드
- 확인하고, 양식 필드가 채워집니다.
- 동일한 양식이 창 패널에서 시작되면 양식 필드가 비어 있습니다.
- 둘 다 사용할 때 'document.body'에 렌더링 된 Form은 이고 닫혀 있고 Window의 양식 필드가 채워집니다.
나는 실수를 저질렀다.
// 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"}]}