EasyUI Forum

General Category => Bug Report => Topic started by: arma on May 05, 2014, 07:23:16 PM



Title: Combobox method getValue() does not return value
Post by: arma on May 05, 2014, 07:23:16 PM
I populate combobox using method reload() as it requires some dynamic parameter

$('#cc').combobox('reload','some/path/url?&param=xxx');
$('#cc').combobox('getData'); <-- ok, return 2 objects with id and text

I then select a combobox item.

$('#cc').combobox('getText'); <-- ok, return selected text
$('#cc').combobox('getValue); <-- not ok, return empty string

What went wrong? Thanks.


Title: Re: Combobox method getValue() does not return value
Post by: stworthy on May 05, 2014, 07:54:05 PM
The default value field name of combobox is 'value' not 'id'. So you have to specify the value field name as 'id'.
Code:
$('#cc').combobox({
  valueField: 'id',
  textField: 'text'
});


Title: Re: Combobox method getValue() does not return value
Post by: arma on May 05, 2014, 07:57:22 PM
Ah yes, i forgot that  ;D thank you stworthy!