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?

|
#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?
![]() |
|
#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. EDIT: 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; ![]() |
|
#4
|
|
Ah, I can add that to the main source. It makes sense. Thanks.
![]() |
|
#5
|
|
No problem, and thank you for adding it to the main source
![]() ![]() |
本文讨论了如何为使用远程数据源的组合框正确设置默认显示值和隐藏字段值。作者提出了一种方法,通过增加hiddenValue选项并在加载时进行判断来实现这一功能。

2894

被折叠的 条评论
为什么被折叠?



