ここで奇妙な問題が発生しているようです。拡張コンポーネントのコードは次のとおりです。
MyApp.panels.RelationshipDetails = Ext.extend(Ext.FormPanel, {
closable: true,
relationshipId: null,
documentId: null,
title: 'Relationship',
initComponent: function () {
if (!this.verifyRequiredData()) {
MyApp.panels.RelationshipDetails.superclass.initComponent.call(this);
return;
}
// Build components
this.tbar = this.buildToolbar();
this.items = this.buildDetailItemArray();
MyApp.panels.RelationshipDetails.superclass.initComponent.call(this);
},
verifyRequiredData: function () {
// Verification code here
},
buildDetailItemArray: function () {
return [{
xtype: 'fieldset',
title: 'Details',
collapsible: true,
autoHeight: true,
items: [{
xtype: 'hidden',
name: 'Id'
}, {
xtype: 'textfield',
fieldLabel: 'Name',
name: 'Name'
}, {
xtype: 'textfield',
fieldLabel: 'Description',
name: 'Description'
}, {
xtype: 'button',
text: 'Save',
name: 'saveButton'
}]
}];
},
buildToolbar: function () {
return new Ext.Toolbar({
// Toolbar Config
});
}
});
問題は、このパネルがレンダリングされるときに、ツールバーだけがレンダリングされることです。BuildDetailItemArray()
デバッグを通じて、それが正しく呼び出され、正しい結果を返していることがわかります。
this.tbar =
ツールバーが存在しない場合、フィールドセットとフィールドが正しくレンダリングされるため、行をコメントアウトするとさらに奇妙になります。Panel
これは、の代わりに拡張しても発生しFormPanel
ます。また、フォームフィールドをそれ自体のコンポーネントに抽象化してみましたが、同じことが起こります。
なぜこれがうまくいかないように見えるのか誰かが知っていますか?