【发布时间】:2011-09-23 08:28:50
【问题描述】:
我有一个组合框,其中的值显示在模板中。
现在,我希望模板的宽度大于组合框的宽度,因此我使用链接中提到的 matchFieldWidth:false - ExtJS ComboBox dropdown width wider than input box width?
但是当我这样做时,在值列表中没有显示滚动条,因此用户只能看到前两个值。一旦 matchFieldWidth:false 被删除,完整的列表就会显示出来,但是模板的宽度会减小到组合框的宽度,这不是我们想要的。
下面是我的代码:
xtype: 'combo',
id: 'testId',
name: 'testName',
displayField: 'vslCd',
valueField: 'vslCd',
fieldLabel: 'Vessel Code',
store: storeVesselCodeVar,
matchFieldWidth: false,
queryMode: 'remote',
listConfig: {
loadingText: 'Loading...',
width: 400,
autoHeight:true,
getInnerTpl: function () {
return '<table><tr><td height="5"></td></tr><tr valign="top"><td>Vessel Code:{vslCd}</td></tr><tr><td height="2"></td></tr><tr valign="top"><td>Vessel Name:{vslNm}</td></tr><tr><td height="5"></td></tr></table>';
}
}
谁能建议这背后的原因以及如何解决这个问题?附上与问题相关的截图。
我正在使用这个 ExtJS4 和 IE9。
【问题讨论】:
-
我已经能够通过向我的模板添加高度来解决这个问题。希望这对其他人有帮助。
-
您应该将此解决方案作为答案发布并接受,以帮助其他用户找到此问题的正确答案。
标签: templates extjs combobox extjs4 width