2

フォームとフィールドセットで非常に長いタイトルをラップするにはどうすればよいですか?

Sencha のドキュメントからこのコードを取得し、単純に長いタイトルを追加し、幅を追加しました。残念ながら、タイトルは省略記号で切り捨てられています。

外観は次のとおりです。 ここに画像の説明を入力

これが変更された Sencha ソースです: ( http://docs.sencha.com/touch/2.2.1/#!/api/Ext.form.FieldSet )

Ext.create('Ext.form.Panel', {
    fullscreen: true,
    items: [
        {
            xtype: 'fieldset',
            title: 'How much wood would a woodchuck chuck if a woodchuck could chuck wood?',
            width: 300,
            instructions: 'Tell us all about yourself',
            items: [
                {
                    xtype: 'textfield',
                    name : 'firstName',
                    label: 'First Name'
                },
                {
                    xtype: 'textfield',
                    name : 'lastName',
                    label: 'Last Name'
                }
            ]
        }
    ]
});
4

1 に答える 1

1

Ext.field.Field labelWrap configを試してください。

Ext.create('Ext.form.Panel', {
    fullscreen: true,
    items: [
        {
            xtype: 'fieldset',
            title: 'How much wood would a woodchuck chuck if a woodchuck could chuck wood?',
            width: 300,
            instructions: 'Tell us all about yourself',
            items: [
                {
                    xtype: 'textfield',
                    name : 'firstName',
                    label: 'First Name',
                    labelWrap : true
                },
                {
                    xtype: 'textfield',
                    name : 'lastName',
                    label: 'Last Name',
                    labelWrap : true
                }
            ]
        }
    ]
});

編集

すみません、一部読み違えました。

私はCSSの専門家であるとは決して主張しません...しかし、これは私にとってはうまくいきました:

.x-form-fieldset-title {
    white-space: normal;
}

これは各タイトルに影響します。長すぎるタイトルだけを選び出すことをお勧めします。

がんばれ、ブラッド

于 2013-07-17T16:16:34.303 に答える