フォームでdoLayoutを呼び出した後、labelWidthプロパティを設定する必要があります。
フォームがレンダリングされた後、doレイアウトへのシーケンスリクエストはフォームのlabelWidthプロパティを無視し、100pxのデフォルトに設定されているようです。
Nipendo.ProformaInvoice.View = Ext.extend(Ext.FormPanel,{
constructor: function (config) {
if (!config) {
Nipendo.showError({ title: 'Error', message: 'A error occurred while loading the invoice view. A configuration element is missing.' });
return;
}
if (!config.invoice) {
Nipendo.showError({ title: 'Error', message: 'A error occurred while loading the invoice view. The invoice element is missing.' });
return;
}
this.topToolbar = this.creatTopToolbar();
this.invoice = config.invoice;
var items = this.createDefaultLayout();
config = Ext.apply({
labelWidth: 140,
bodyStyle: 'padding:2px 5px;',
autoScroll: true,
tbar: this.topToolbar,
items: items
}, config);
Nipendo.ProformaInvoice.View.superclass.constructor.call(this, config);
}, // eo constructor
// private
handelBackToDefaultView: function (switchToView) {
if (this.currentViewName == 'sidebyside') {
this.removeAll();
this.currentViewName = switchToView;
this.add(this.createDefaultLayout());
this.doLayout();
}
this.currentViewName = switchToView;
}, //eo handelBackToDefaultView
})
handelBackToDefaultViewを呼び出した後、すべてのラベルが100pxに設定されています。
助けてくれてありがとう