我需要在表单上调用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。
感谢您的帮助
答案 0 :(得分:0)
我自己找到了问题,
问题是我创建的布局新方面确实创建了一个新面板作为表单的第一项,该面板缺少labelWidth属性以固有所有内部字段。