Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/javascript/469.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/extjs/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript extjs3.4:将组合的选定值连接到标签文本中_Javascript_Extjs_Combobox_Label - Fatal编程技术网

Javascript extjs3.4:将组合的选定值连接到标签文本中

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 :

我在表单面板中有一个Ext组合框,如下所示

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更好的组合框来访问您,因为它非常慢