首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >使用extjs的IE7 tbar行分隔符中的问题

使用extjs的IE7 tbar行分隔符中的问题
EN

Stack Overflow用户
提问于 2012-09-20 18:41:46
回答 2查看 325关注 0票数 2

我需要一个组件在顶部栏的下一行。我这样编码的,

代码语言:javascript
复制
tbar: [{
    xtype: 'textfield'
    id:'fname'
},'-',{
    xtype: 'textfield'
    ,id: 'lname'
},'<row>',{
    xtype: 'textfield'
    ,id:'mob'
}]

这在chrome,火狐和ie7+浏览器中工作得很好,但在ie7中不工作。有人能纠正我的代码吗?

EN

回答 2

Stack Overflow用户

发布于 2012-09-20 19:51:12

您的xtype:'textfield‘后没有逗号。

在JavaScript中,IE7对逗号非常敏感。

代码语言:javascript
复制
tbar: [{
    xtype: 'textfield'
    ,id:'fname'
},'-',{
    xtype: 'textfield'
    ,id: 'lname'
},'<row>',{
    xtype: 'textfield'
    ,id:'mob'
}]

编辑:我做了这个小提琴,它可以在所有浏览器中工作:

http://jsfiddle.net/MG3fS/3/

票数 0
EN

Stack Overflow用户

发布于 2012-09-25 03:22:00

一种非常原始的方法呢?

代码语言:javascript
复制
tbar : {
    layout : 'auto', // im not sure why 'vbox' does not work here
    width: 200,
    items : [{
        xtype: 'container',
        layout: 'hbox',
        items : [{
            xtype: 'textfield',
            id:'fname'
        }, {
            xtype: 'container',
            html: '-',
            width: 5
        }, {
            xtype: 'textfield',
            id: 'lname'
        }]
    }, {
        xtype: 'textfield',
        id : 'mob'
    }]
}
票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/12510960

复制
相关文章

相似问题

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