Dear team,
I have nearly tried everything to manage to fill a combobox with java script. I got a component where I retrieve 2 strings which I want to show in the combobox.
The problem is, that I always get a null value for cmbSource.
Any ideas?
// edit: I also tried it with a listbox. Same problem.
I have nearly tried everything to manage to fill a combobox with java script. I got a component where I retrieve 2 strings which I want to show in the combobox.
The problem is, that I always get a null value for cmbSource.
Any ideas?
// edit: I also tried it with a listbox. Same problem.
cmbSource = $get('< %= listBoxSource.ClientID %>');
always returns null...
<
script
type
=
"text/javascript"
>
$(document).ready(function () {
var cmbSource = $find('<%= comboboxSource.ClientID %>');
init(cmbSource); // function to fill in the values
});
</
script
>
// in a table, embedded in a asp Panel
<
telerik:RadComboBox
ID
=
"comboboxSource"
runat
=
"server"
Width
=
"35%"
/>
// in java script
function init(comboboxSource) {
var comboItem = new Telerik.Web.UI.RadComboBoxItem();
comboItem.set_text("test");
comboboxSource.get_items().add(comboItem);
comboboxSource.commitChanges();
}