This is a migrated thread and some comments may be shown as answers.

Filling Combobox on client side doesn't work

0 Answers 75 Views
ComboBox
This is a migrated thread and some comments may be shown as answers.
Endof
Top achievements
Rank 1
Endof asked on 12 Apr 2012, 08:12 AM
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.

 

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();
}

No answers yet. Maybe you can help?

Tags
ComboBox
Asked by
Endof
Top achievements
Rank 1
Share this question
or