Javascript extjs3.4:将组合的选定值连接到标签文本中
我在表单面板中有一个Ext组合框,如下所示Javascript extjs3.4:将组合的选定值连接到标签文本中,javascript,extjs,combobox,label,Javascript,Extjs,Combobox,Label,我在表单面板中有一个Ext组合框,如下所示 new Ext.form.ComboBox({ store : routeStore, displayField : 'rName', valueField : 'rName', fieldLabel : 'Select Fixed Route', id : 'routeCombo', typeAhead : true, forceSelection : true, mode :
new Ext.form.ComboBox({
store : routeStore,
displayField : 'rName',
valueField : 'rName',
fieldLabel : 'Select Fixed Route',
id : 'routeCombo',
typeAhead : true,
forceSelection : true,
mode : 'local',
triggerAction : 'all',
selectOnFocus : true,
editable : true,
hidden : false,
disabled : true,
minChars : 1,
hideLabel : true,
width : 210,
emptyText : 'Select Fixed Route'
})
我还有一个这样的标签
{
xtype : 'label',
id : 'idTourCode',
text : 'SystemDate',
forId : 'myFieldId',
style : 'marginleft:10px',
//autoWidth : true,
flex : 1
}
现在,我需要将组合框的选定值连接到标签文本。此标签已包含文本。我想要的是,组合的选定值应该连接到此标签文本。所有这些事情都应该在点击按钮时发生
我试图找到一个解决办法,但没有成功。因此,请帮助我澄清我的问题
Thanx很多这是一个粗糙的修复
将其添加到您的组合框:
listeners: {
change: function(box, newValue)
{
Ext.ComponentQuery.query("#myLabel")[0].setText(newValue)
}
将此添加到您的标签:
itemId: 'myLabel'
您应该对此稍加润色,并找到一个比Ext.ComponentQuery更好的组合框来访问您,因为它非常慢