EasyUI
Home
Demo
Tutorial
Documentation
Download
Extension
Contact
Forum
EasyUI Forum
April 28, 2024, 07:26:30 PM
Welcome,
Guest
. Please
login
or
register
.
1 Hour
1 Day
1 Week
1 Month
Forever
Login with username, password and session length
News
:
Home
Help
Search
Login
Register
EasyUI Forum
>
General Category
>
General Discussion
>
access text value in combobox
Pages: [
1
]
« previous
next »
Print
Author
Topic: access text value in combobox (Read 20075 times)
wymak
Newbie
Posts: 26
access text value in combobox
«
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
Re: access text value in combobox
«
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
Re: access text value in combobox
«
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
Re: access text value in combobox
«
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
Re: access text value in combobox
«
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
Re: access text value in combobox
«
Reply #5 on:
February 17, 2013, 03:10:50 PM »
did you try with xxx.value ?
Logged
Pages: [
1
]
Print
« previous
next »
Jump to:
Please select a destination:
-----------------------------
General Category
-----------------------------
=> News
=> General Discussion
=> EasyUI for jQuery
=> EasyUI for Angular
=> EasyUI for Vue
=> EasyUI for React
=> Bug Report
Loading...