首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >Extjs 4,在tbar中排列表单域

Extjs 4,在tbar中排列表单域
EN

Stack Overflow用户
提问于 2012-02-28 05:22:10
回答 1查看 3.5K关注 0票数 2

代码语言:javascript
复制
tbar : new Ext.Toolbar({
    items : [
        '',{
        xtype : 'radiofield',
        name : 'searchType',
        value : 'order_name',
        boxLabel : 'Order Name'
        },'',{
        xtype : 'radiofield',
        name : 'searchType',
        value : 'order_no',
        boxLabel : 'Order No'
        },'',{
        xtype : 'radiofield',
        name : 'searchType',
        value : 'status',
        boxLabel : 'Status'
        },'=',{
        xtype : 'textfield',
        name : 'keyword',
        value : 'Keyword'
        },'|',{
        xtype : 'datefield',
        name : 'order_from',
        fieldLabel : 'From ',
        labelStyle : 'width:50px',
        value : new Date()
        },'~',{
        xtype : 'datefield',
        name : 'order_to',
        fieldLabel : "To ",
        labelStyle : 'width:50px',
        value : new Date()
        },'|',{
        xtype : 'button',
        text : "Search"
        }
    ]
    })

我把我的问题放在附图中。

(比率按钮之间的空格和删除日期字段中奇怪的右边距空格。)

并且tbar中的按钮看起来不像按钮。它看起来只是文本。有人知道让它好看的按钮吗?

谢谢!

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2012-02-28 07:54:08

为了增加空格,你可以在引号中添加,基本上任何html都可以插入,包括图像。

额外的空间与日期字段试图获取的宽度相关。您不应该在labelStyle中设置宽度,而应该直接设置它,以便字段可以正确地计算出它所需的空间量。例如:

代码语言:javascript
复制
labelWidth: 50, //label only
width: 200,  //label + input

您的实际示例:http://jsfiddle.net/dbrin/PhAbR/2/

票数 2
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/9472481

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档