我最近将我的Ext版本从4.0.7升级到4.1
我使用"tbar“配置在顶部附加了带有组合的Grid。现在我面临的问题是,即使有数据或没有数据,我的组合也不会采用适当的宽度。我给了宽度,然后它也不能正常工作。
我有附加的图像作为参考,请在它有一个战利品。
这是我的网格代码
Ext.create('Ext.grid.Panel', {
id: 'SourceGridPanelId',
forceFit: true,
autoScroll:true,
store: sourceGridStore,
sortableColumns:false,
enableColumnHide:false,
tbar: createSourceSiteCombo(sourceSiteStore)这是我的组合代码
var sourceCombo= Ext.create('Ext.form.ComboBox', {
id: "sourceSiteID",
fieldLabel:'Select Site',
inputId: "sourceSiteID_input",
store: sourceSiteStore,
queryMode: 'local',
displayField: 'sourceSiteName',
valueField: 'sourceSiteId',
width:200
});

请建议这里缺少的内容。
var combo=Ext.create('Ext.form.ComboBox',
{
multiSelect : false,
id:'SelectComponentId',
name:'SelectComponentId',
allowBlank: true,
inputId:'SelectComponentId_input',
hideTrigger: false,
editable: false,
selectOnFocus: false,
typeAhead: false,
disabled: false,
readOnly: false,
width: 312,
store: [['-1','Select User'],['59','Yagna Tel Clear']],
value:'-1',
renderTo:'UserBO_SelectComponentId_Div',
triggerAction: 'all'
});在上面的代码中,如果我去掉宽度,它可以很好地工作,但采用默认宽度,但我想分配宽度。请建议这里缺少的内容
发布于 2013-01-12 06:30:29
宽度包括labelWidth。因此,如果您的字段标签的宽度为200,并且您希望字段的宽度也为200,则需要将宽度设置为400 (+边距)。
发布于 2012-06-30 02:02:21
我也有同样的问题。您需要将字段标签从combobox配置中取出,并以这种方式进行设置,在fieldname的工具栏中使用一个文本对象:
dockedItems: [
{
xtype: "toolbar",
dock: "top",
items: [
{
xtype: "tbtext",
style: "font-weight:bold;",
text: "Select Site:"
},
createSourceSiteCombo(sourceSiteStore)
]
}
]我相信,由于某种原因,从fieldLabel创建的fieldLabel dom对象搞砸了工具栏渲染。
(停靠的项目取代了tbar,现在是创建工具栏的标准方式)。
https://stackoverflow.com/questions/11150481
复制相似问题