最早写的一个页面的combobox一点儿问题都没有,
后来又写的一个页面也用到了combobox,结果是整个页面的combobox都不显示fieldlabel(前面的标题文本)
firefox 的 debug 和 ie 的调试都没有报错,上网也找不到相关问题,赶项目。。。。。
显示效果见图片
combobox的代码如下:
xtype : 'combo',
fieldLabel : '地区',
hiddenName : 'region',
name : 'customerRegion',
forceSelection : true,
store : new Ext.data.Store({ autoLoad : true,
reader : new Ext.data.JsonReader( {
totalRecords : "count",
root : "regions",
id : 'id'
}, Ext.data.Record.create( [
{name : 'item'},
{name : 'value'}
])
), proxy : new Ext.data.HttpProxy({ url : 'customer/regionDictionary.action' })
}),
displayField : 'item',
valueField : 'value',
emptyText : '请选择',
后来又写的一个页面也用到了combobox,结果是整个页面的combobox都不显示fieldlabel(前面的标题文本)
firefox 的 debug 和 ie 的调试都没有报错,上网也找不到相关问题,赶项目。。。。。
显示效果见图片
combobox的代码如下:
xtype : 'combo',
fieldLabel : '地区',
hiddenName : 'region',
name : 'customerRegion',
forceSelection : true,
store : new Ext.data.Store({ autoLoad : true,
reader : new Ext.data.JsonReader( {
totalRecords : "count",
root : "regions",
id : 'id'
}, Ext.data.Record.create( [
{name : 'item'},
{name : 'value'}
])
), proxy : new Ext.data.HttpProxy({ url : 'customer/regionDictionary.action' })
}),
displayField : 'item',
valueField : 'value',
emptyText : '请选择',
mode : 'local'
fieldLabel只有在组件的父容器为form布局时才有效
如果父容器为form布局,你的combobox不可能和左边的名称同属一行,你要注意的是直属父容器。
这里应该用到了column或hbox布局
已解决。。改了格式,这个样子就好了:
layout : 'form',
defaultType : 'combo',
items : [{属性}]