开发者

Is there a way to display a line between labels and data columns in an Ext JS form?

开发者 https://www.devze.com 2023-02-16 23:04 出处:网络
How can I add a thin, gray line as shown here between the label and field columns of an Ext JS form? I drew the line above with a graphics program but the form itself is being created with this cod

How can I add a thin, gray line as shown here between the label and field columns of an Ext JS form?

Is there a way to display a line between labels and data columns in an Ext JS form?

I drew the line above with a graphics program but the form itself is being created with this code:

var form_customer_contact = new Ext.FormPanel({
    frame:true,
    labelWidth: 140,
    labelAlign: 'left',
    bodyStyle:'padding:10px',
    width: 300,
    height: 600,
    autoScroll: true,
    itemCls: 'form_row',
    defaultType: 'displayfield',
    items: [{
            fieldLabel: 'Cus开发者_开发知识库tomer Contact',
            name: 'customerContact',
            allowBlank:false,
            value: 'Mr. Smith'
        },
        createCombo('Reason for Contact', 'reason', ['data correction', 'new contact', 'missing information']),
        createCombo('Result', 'result', ['new data', 'old data', 'other data']),
        createCombo('Communication', 'communication', ['telephone', 'fax', 'e-mail']),
        createCombo('Related Order', 'relatedOrder', ['345234534','3453453452', '2234234234'])
        , {
            fieldLabel: 'Date',
            xtype: 'datefield',
            name: 'theDate',
            format: 'd.m.Y',
            width: 150,
            id: 'theDate',
            vtype: 'daterange'
        }, {
            fieldLabel: 'Time',
            xtype: 'timefield',
            name: 'theTime',
            format: 'h:i:s',
            width: 150,
            id: 'theTime'
        },{
            fieldLabel: 'Notes',
            name: 'relatedOrder',
            value: 'These are the notes and they are very long and these are more notes and they are very long and these are more notes and they are very long and these are more notes and they are very long and these are more.'
        }
    ]
});


You could perhaps add a border-right to the label.x-form-item-label that's rendered by the ExtJS form elements. But that will end in a endless struggle with CSS because you have floated elements which don't have the same height.

The best way actually is to use a background-image either on the div.x-form-label-left that surrounds the <form> or on the form.x-form itself. Not nice but the only way we achieved what we wanted (and that's exactly what you've asked for).

0

精彩评论

暂无评论...
验证码 换一张
取 消