EasyUI Forum

General Category => EasyUI for jQuery => Topic started by: devnull on November 30, 2014, 12:28:11 AM



Title: Load combobox with data from another
Post by: devnull 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')
})



Title: Re: Load combobox with data from another
Post by: stworthy 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
})
}
})