EasyUI Forum
May 27, 2024, 03:45:25 PM *
Welcome, Guest. Please login or register.

Login with username, password and session length
News:
 
   Home   Help Search Login Register  
Pages: [1]
  Print  
Author Topic: Combobox selected but not returned any value  (Read 7490 times)
arma
Full Member
***
Posts: 110


View Profile
« on: February 04, 2015, 11:46:33 PM »

I've faced this problem and can not find why. Here's my code on document ready.

Code:
$('#cb-year').combobox({
            valueField: 'id',
            textField: 'text'
});

$('#cb-year').combobox('loadData', years); //years is json variable
$('#cb-year').combobox('setValue', '2015')
;

When i click combobox, i see '2015' is higligted, but when i run $('#cb-year').combobox('getValue') in browser console, it returns empty string.
if i ('getData'), the data returned seems correct [{id:'2015', text: '2015'}, and so on].

Any clue why ?
Logged
jarry
Administrator
Hero Member
*****
Posts: 2264


View Profile Email
« Reply #1 on: February 05, 2015, 12:40:13 AM »

Please refer to http://jsfiddle.net/kkcf1d2w/
Logged
arma
Full Member
***
Posts: 110


View Profile
« Reply #2 on: February 25, 2015, 03:02:25 AM »

Hi Jarry,

I use 1.3.6. Do you have hosted minified jeasyui with that version, so i can change the external dependency/resource in you fiddle ?

Thanks.
Logged
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines Valid XHTML 1.0! Valid CSS!