Как вызвать метод formpanel.getForm (), когда я пытаюсь переопределить formpanel Ext?
commentsForm = Ext.extend(Ext.form.FormPanel, {
frame: true,
initComponent: function() {
var config = {
frame : true,
autoScroll : true,
labelWidth : 150,
autoWidth : true,
labelPad : 20,
waitMsgTarget: true,
bodyStyle:'padding:0px 15px 15px 15px',
items: [{
xtype : 'fieldset',
title : 'Write Comment',
anchor : '100%',
defaults : {
selectOnFocus: true,
msgTarget: 'side',
xtype: 'textfield',
width : 200
},
items : [{
xtype : 'textarea',
name : 'comment',
allowBlank : false
}, {
name : 'added_by',
allowBlank : false
}, {
xtype : 'myndatefield',
name : 'added_at',
allowBlank : false,
value : new Date()
}]
}],
buttons: [{
text: 'Add',
handler : function() {
// TODO
var classForm = this.getForm();
console.log(this.getForm());
if (classForm.isValid()) {
console.log(classForm.findField("name"));
}
Ext.WindowMgr.hideAll();
}
}, {
text: 'Cancel',
handler : function() {
Ext.WindowMgr.hideAll();
}
}]
};
Ext.apply(this, Ext.apply(this.initialConfig, config));
myn.commentsForm.superclass.initComponent.apply(this);
}
});