'IMS.SellMgt.testForm'클래스를 정의했습니다. '제출'버튼을 클릭하면 'var test = this.formPanel;'을 가져오고 싶습니다. 왜 테스트가 null입니까? 내가 이걸 얻고 싶다면 폼 패널. 어떻게 할 수 있니? 고마워! 같은Extjs에서 클래스 인스턴스를 얻으려면 어떻게해야합니까?
Ext.define('IMS.SellMgt.testForm', {
formPanel: null,
LoadForm: function() {
this.formPanel = new Ext.form.Panel({
renderTo: 'form-ct',
frame: true,
title: 'XML Form',
width: 300,
items: [{
xtype: 'fieldset',
title: 'Contact Information',
defaultType: 'textfield',
items: [{
fieldLabel: 'First Name',
emptyText: 'First Name',
name: 'first'
}
]
}],
buttons: [{
text: 'Submit',
handler: function() {
var test = this.formPanel;
}
}]
});
}
});
Ext.onReady(function() {
var frmTest = Ext.create('IMS.SellMgt.testForm', {});
frmTest.LoadForm();
});