ExtJS: How to submit both: combobox value and text

后端 未结 2 818
盖世英雄少女心
盖世英雄少女心 2021-01-23 03:05

ExtJS: How to submit both: combobox value and text using standardSubmit?

2条回答
  •  没有蜡笔的小新
    2021-01-23 03:39

    If you want to submit two values, you will need two fields. If you want both fields to be controlled by one field, you should make one field hidden, and update it when the first is updated:

    var hiddenField = new Ext.form.Hidden({
        name: 'comboDisplay'
    });
    
    var combo = new Ext.form.ComboBox({
        xtype: 'combo',
        // ...
        listeners: {
            select: function(combo, record) {
                hiddenField.setValue(record.data['display']);
            }
        }
    });
    

提交回复
热议问题