javascript - 有没有办法在 Ext JS 表单中的标签和数据列之间显示一条线?

标签 javascript forms extjs

如何在 Ext JS 表单的标签列和字段列之间添加一条细灰色线(如此处所示)?

enter image description here

我用图形程序绘制了上面的线,但表单本身是用以下代码创建的:

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: 'Customer 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.'
        }
    ]
});

最佳答案

您也许可以添加 border-rightlabel.x-form-item-label由 ExtJS 表单元素呈现。但这会导致与 CSS 的无休止的斗争,因为 float 元素的高度不同。

实际上最好的方法是使用 background-image要么在 div.x-form-label-left围绕<form>或上form.x-form本身。不太好,但这是我们实现我们想要的目标的唯一方法(这正是您所要求的)。

关于javascript - 有没有办法在 Ext JS 表单中的标签和数据列之间显示一条线?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/5323561/

相关文章:

jquery - 使用 jQuery 提交数组的动态 HTML

javascript - 在提交时响应 GET 表单数据

css - 工具提示中的列数据溢出

javascript - EXTJS 文件上传 - IE8 安全栏问题

ExtJS 3.4 Radiogroup strech 关闭

用于固定导航栏的 Javascript 和 Jquery 在在线时停止工作(网络服务器)

javascript - 如何从组件 <video></video> 获取帧

javascript - Bootstrap轮播: Slide Thumbnail with Carousel

javascript - 密码 : "Atleast 1 letter, 1 number, 1 special character and SHOULD NOT start with a special character" 的正则表达式

php - 停止欺骗性表单提交