EasyUI Forum
April 28, 2024, 04:33:24 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: access text value in combobox  (Read 20074 times)
wymak
Newbie
*
Posts: 26


View Profile
« 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.
Logged
stworthy
Administrator
Hero Member
*****
Posts: 3581


View Profile Email
« Reply #1 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);
Logged
wymak
Newbie
*
Posts: 26


View Profile
« Reply #2 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;
Logged
stworthy
Administrator
Hero Member
*****
Posts: 3581


View Profile Email
« Reply #3 on: February 13, 2013, 05:54:20 AM »

Call getData method to get loaded items.
Code:
var items = $('#cc').combobox('getData');
Logged
wymak
Newbie
*
Posts: 26


View Profile
« Reply #4 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?
Logged
ClSoft
Jr. Member
**
Posts: 92


View Profile
« Reply #5 on: February 17, 2013, 03:10:50 PM »

did you try with xxx.value ?
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!