Html 使用extjs的IE7 tbar行分隔器中的问题

Html 使用extjs的IE7 tbar行分隔器中的问题,html,internet-explorer,extjs,internet-explorer-7,extjs3,Html,Internet Explorer,Extjs,Internet Explorer 7,Extjs3,我需要一个组件在顶栏的下一行我这样编码 tbar: [{ xtype: 'textfield' id:'fname' },'-',{ xtype: 'textfield' ,id: 'lname' },'<row>',{ xtype: 'textfield' ,id:'mob' }] tbar:[{ xtype:'textfield' id:'fname' },'-',{ xtype:'textfield' ,id:'lname' }

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

tbar: [{
    xtype: 'textfield'
    id:'fname'
},'-',{
    xtype: 'textfield'
    ,id: 'lname'
},'<row>',{
    xtype: 'textfield'
    ,id:'mob'
}]
tbar:[{
xtype:'textfield'
id:'fname'
},'-',{
xtype:'textfield'
,id:'lname'
},'',{
xtype:'textfield'
,id:'mob'
}]

这在chrome、firefox和ie7+浏览器中运行良好,但在ie7中不起作用。请有人更正我的代码。

您的xtype:“textfield”后没有逗号

IE7在JavaScript中对逗号非常敏感

tbar: [{
    xtype: 'textfield'
    ,id:'fname'
},'-',{
    xtype: 'textfield'
    ,id: 'lname'
},'<row>',{
    xtype: 'textfield'
    ,id:'mob'
}]
tbar:[{
xtype:'textfield'
,id:'fname'
},'-',{
xtype:'textfield'
,id:'lname'
},'',{
xtype:'textfield'
,id:'mob'
}]
编辑:我制作了这个小提琴,它适用于所有浏览器:


在xtype:“textfield”之后没有逗号

IE7在JavaScript中对逗号非常敏感

tbar: [{
    xtype: 'textfield'
    ,id:'fname'
},'-',{
    xtype: 'textfield'
    ,id: 'lname'
},'<row>',{
    xtype: 'textfield'
    ,id:'mob'
}]
tbar:[{
xtype:'textfield'
,id:'fname'
},'-',{
xtype:'textfield'
,id:'lname'
},'',{
xtype:'textfield'
,id:'mob'
}]
编辑:我制作了这个小提琴,它适用于所有浏览器:


一种非常原始的方法怎么样

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'
    }]
}

那么一种非常原始的方法呢

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'
    }]
}

使用此方法时,我收到以下错误“无法读取未定义的属性'ownerCt'。抱歉,我似乎在最后一个组件的cfg中留下了一个打字错误。xtype是“texfield”而不是“textfield”。编辑:似乎还有不必要的逗号。现在已修复(虽然我不确定是否是它导致了您的错误)在使用此方法时,我收到以下错误“无法读取未定义的属性'ownerCt'。抱歉,似乎我在最后一个组件的cfg中留下了一个打字错误。xtype是“texfield”而不是“textfield”。编辑:似乎还有不必要的逗号。现在已修复(尽管我不确定是否是它导致了您的错误)