1

フォームで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に設定されています。

助けてくれてありがとう

4

1 に答える 1

0

私は自分で問題を見つけました、

問題は、私が作成した新しいサイドバイレイアウトがフォームの最初のアイテムとして新しいパネルを作成したことでした。そのパネルには、すべての内部フィールドに固有のlabelWidthプロパティがありませんでした。

于 2012-08-07T06:08:46.337 に答える