PDA

View Full Version : Posting Wrong Values



Gamer
17 Mar 2011, 5:48 AM
I have a component that I have built, and I am checking in the chrome console to make sure that it is posting the correct values. For one of them it is, and the other is not.


fields: ['id', 'name'],
data : [
['STARTSWITH', 'Starts With'],
['LIKE', 'Equals'],
['NOT LIKE', 'Doesn\'t Equal'],
['CONTAINS', 'Contains'],
['NOTCONTAIN', 'Doesn\'t Contain'],
['ENDSWITH', 'Ends With']
]
It is a combobox where the id value is supposed to be posted, I have valueField: 'id'.
It is currently returning something like this :
textcombo:Contains - 'name' not 'id'
txtfield:dsfasdfads
Any ideas why this would happen? Any help is appreciated!

fay
17 Mar 2011, 6:54 AM
Post the full config of the combobox.

Gamer
17 Mar 2011, 7:22 AM
store: store,
fieldLabel:this.fieldLabel || 'Text Operators',
displayField: 'name',
valueField: 'id',
//hiddenName:'name',
typeAhead: true,
mode: 'local',
forceSelection: true,
triggerAction: 'all',
emptyText:'Select an operator...',
selectOnFocus:true,
hideTrigger1 : false, //combo
hideTrigger2 : false, //clear
hideTrigger3 : true, //search
hideTrigger4 : true //add

fay
17 Mar 2011, 7:54 AM
You need to specify a hiddenName; from the docs (http://dev.sencha.com/deploy/dev/docs/?class=Ext.form.ComboBox):



...to submit the valueField (http://dev.sencha.com/deploy/dev/docs/output/Ext.form.ComboBox.html#Ext.form.ComboBox-valueField), you must specify a hiddenName (http://dev.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.

Gamer
17 Mar 2011, 9:17 AM
then it returns as the hiddenfield
name:NOTCONTAIN
txtfield:dsfasdf
I want it to return as the name of the combobox
name: 'textcombo',
or
textcombo:NOTCONTAIN
txtfield:dsfasdf
Is there any way to do that?