我需要一个组件在顶部栏的下一行。我这样编码的,
tbar: [{
xtype: 'textfield'
id:'fname'
},'-',{
xtype: 'textfield'
,id: 'lname'
},'<row>',{
xtype: 'textfield'
,id:'mob'
}]这在chrome,火狐和ie7+浏览器中工作得很好,但在ie7中不工作。有人能纠正我的代码吗?
发布于 2012-09-20 19:51:12
您的xtype:'textfield‘后没有逗号。
在JavaScript中,IE7对逗号非常敏感。
tbar: [{
xtype: 'textfield'
,id:'fname'
},'-',{
xtype: 'textfield'
,id: 'lname'
},'<row>',{
xtype: 'textfield'
,id:'mob'
}]编辑:我做了这个小提琴,它可以在所有浏览器中工作:
http://jsfiddle.net/MG3fS/3/
发布于 2012-09-25 03:22:00
一种非常原始的方法呢?
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'
}]
}https://stackoverflow.com/questions/12510960
复制相似问题