ExtJS:如何同时提交:组合框值和文本 [英] ExtJS: How to submit both: combobox value and text

查看:13
本文介绍了ExtJS:如何同时提交:组合框值和文本的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

ExtJS:如何使用standardSubmit 提交组合框值和文本?

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

推荐答案

要提交 valueField,您必须指定一个 hiddenName 以创建一个隐藏输入字段来保存 valueField 的值.您还必须将 submitValue 设置为 true

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

例如

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'
});

所以你得到作为 unitId 发送的值和作为单元发送的文本

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

这篇关于ExtJS:如何同时提交:组合框值和文本的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆