9 Mar 2007 2:30 AM #1
Combobox - default value
I use a remote dataset with a key=>value combobox. I got it working without much problems. The only thing I'm missing is to set a default value for the valueField AND the displayField. Is this not supported (yet) or am I just missing something?
9 Mar 2007 2:27 PM #2
What do you mean, when it's loaded? You can pass in a value: 'foo', or it will read an existing text field for its value, or if tranforming a select it will use the selects selected value. Is that not what you want?
11 Mar 2007 11:58 PM #3
I have a combobox with a JSON source. When the combobox loads there are no records available yet to the combobox. Also, I don't want to trigger a http-request just to fetch the default value.
My combobox uses the hidden field to supply a key instead of the displayed value.
To correctly set the default value I have to set both the display value and the hidden key value.
I just tried to add it to your code and it was actually very simple. I added the option hiddenValue and changed line 108 (was 107 before adding the hiddenValue option):
this.hiddenField.value = this.value;
this.hiddenField.value = this.hiddenValue || this.value;
12 Mar 2007 10:00 PM #4
Ah, I can add that to the main source. It makes sense. Thanks.
12 Mar 2007 11:56 PM #5
No problem, and thank you for adding it to the main source
By Animal in forum Ext 2.x: Help & DiscussionReplies: 0Last Post: 30 Mar 2007, 11:23 PM
By SteveEisner in forum Community DiscussionReplies: 0Last Post: 12 Nov 2006, 11:58 PM