EasyUI Forum

General Category => General Discussion => Topic started by: wymak on February 11, 2013, 03:17:03 AM



Title: access text value in combobox
Post by: wymak on February 11, 2013, 03:17:03 AM
How to access the text of, say, 3rd element of the combobox value? the following not work.

$var =  $('#cc').combobox('getData').data;
alert($var[1][2]);

thanks.


Title: Re: access text value in combobox
Post by: stworthy on February 11, 2013, 12:08:55 PM
Please call getText method to get text value displaying on input box.
Code:
var tt = $('#cc').combobox('getText');
alert(tt);


Title: Re: access text value in combobox
Post by: wymak on February 13, 2013, 12:55:36 AM
How to get the array of items in the combobox? the following did not work:

$var =  $('#cc').combobox('getData').data;


Title: Re: access text value in combobox
Post by: stworthy on February 13, 2013, 05:54:20 AM
Call getData method to get loaded items.
Code:
var items = $('#cc').combobox('getData');


Title: Re: access text value in combobox
Post by: wymak on February 14, 2013, 07:22:45 PM
is the variable 'items' an array?
I try alert(items[0]), it display [object object]. How can I display the content?


Title: Re: access text value in combobox
Post by: ClSoft on February 17, 2013, 03:10:50 PM
did you try with xxx.value ?