ExtJS: How to submit both: combobox value and text

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

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

2条回答
  •  野性不改
    2021-01-23 03:22

    To submit the valueField, you must specify a hiddenName to create a hidden input field to hold the value of the valueField. You must also set submitValue to true

    e.g.

    var unitField = new Ext.form.ComboBox({
        id:'unitField',
        name: 'unit',
        submitValue : true,
        fieldLabel: 'Unit',
        store:unitStore,
        mode: 'remote',
        displayField: 'name',
        valueField: 'id',
        hiddenName : 'unitId',
        allowBlank: false,
        anchor:'95%',
        triggerAction: 'all'
    });
    

    So you get the value sent as unitId and the text as unit

提交回复
热议问题