View Full Version : ComboBox + Modal Window = Description submited

22 Jul 2010, 6:59 PM
Hi All!

I have a grid with a tbar. The tbar have one button that calls an function that create a modal window with one forms.

The forms have a ComboBox that is loaded with Ext.data.Store. At this point everything is OK.

1. When i submit the form, the description value is sent instead of the value (id).

2. If i set the value on the construction of the item, the description shows the id instead of the description.

3. If i use console.log to see the data, the id and description is correct.

Bing Qiao
23 Jul 2010, 1:03 AM
Quote from API documentation:

A ComboBox works in a similar manner to a traditional HTML <select> field. The difference is that to submit the valueField (http://www.sencha.com/deploy/dev/docs/output/Ext.form.ComboBox.html#Ext.form.ComboBox-valueField), you must specify a hiddenName (http://www.sencha.com/deploy/dev/docs/output/Ext.form.ComboBox.html#Ext.form.ComboBox-hiddenName) to create a hidden input field to hold the value of the valueField. The displayField (http://www.sencha.com/deploy/dev/docs/output/Ext.form.ComboBox.html#Ext.form.ComboBox-displayField) is shown in the text field which is named according to the name (http://www.sencha.com/deploy/dev/docs/output/Ext.form.ComboBox.html#Ext.form.ComboBox-name).

23 Jul 2010, 1:29 AM
Post your combo's config; it's likely that you've not specified hiddenName. See hiddenName (http://www.sencha.com/deploy/dev/docs/?class=Ext.form.ComboBox&member=hiddenName).

26 Jul 2010, 4:06 PM
Yep. Thanks Bing & Fay, hiddenName solved my problem.