EasyUI Forum
June 22, 2024, 06:53:29 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: Load combobox with data from another  (Read 6066 times)
devnull
Sr. Member
****
Posts: 431


View Profile
« on: November 30, 2014, 12:28:11 AM »

I was expecting this to work, but it doesn't.

Am I not able to load one combobox directly with data from another without needing to loop through the data array ?

Code:
$('#cb2').combobox('loadData',$('#cb1).combobox('getData'));

or

$('#cb2').combobox({
  data: $('#cb1).combobox('getData')
})

« Last Edit: November 30, 2014, 12:33:43 AM by devnull » Logged

-- Licensed User --
stworthy
Administrator
Hero Member
*****
Posts: 3581


View Profile Email
« Reply #1 on: November 30, 2014, 07:59:06 AM »

Make sure the '#cb1' combobox data has been loaded successfully before loading it to another combobox component.
Code:
$('#cb1').combobox({
onLoadSuccess:function(data){
$('#cb2').combobox({
data: data
})
}
})
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!