简体   繁体   English

ExtJS组合框值字段

[英]ExtJS combo-box value field

I'm using ExtJS in CodeIgniter (a PHP framework) 我在CodeIgniter(PHP框架)中使用ExtJS

I want to store the valueField of a combobox in a database. 我想将comboboxvalueField存储在数据库中。 I set displayField:'name', valueField:'id' for the combobox, but when i used $this->input->post(combofield name); 我为组合框设置了displayField:'name', valueField:'id' ,但是当我使用$this->input->post(combofield name); it is returning the displayField instead. 它返回的是displayField

How am I able to get the valueField ? 我如何获得valueField

You have to set the hiddeName property or else it will send the displayField value not the valueField. 您必须设置hiddeName属性,否则它将发送displayField值而不是valueField。 Make sure you name it differently than the displayField. 确保您命名的名称与displayField不同。

Put this on your properties: 把它放在你的属性上:

    displayField:'state',
    valueField: 'id', 
    hiddenName: "id",

I have no knowledge of PHP ; 我不懂PHP ; but i guess you want to post the data as of valueField but displayField is being posted instead. 但是我猜你想从valueField发布数据,但是要发布displayField If yes, then i would request you to check the name property and id property as well with anyother form fields for it's uniquness . 如果是,那么我将要求您检查name属性和id属性以及其他表单字段的唯一性

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM