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

change items in a kendoComboox

0 Answers 141 Views
ComboBox
This is a migrated thread and some comments may be shown as answers.
pasquale
Top achievements
Rank 1
pasquale asked on 29 Feb 2012, 09:41 AM
hello!!!
i hope someone can help me...
i fill a combobox with a variable, but when i push a button, i need to change items in smy comboBox.. this is my code

<script type="text/javascript">
        var combobox;
        var data = [
                        { text: "White", value: "1" },
                        { text: "Black", value: "2" }
                    ];
 $(document).ready(function () {
               combobox = $("#cmb").kendoComboBox({
                dataSource: data,
                dataTextField: "text",
                dataValueField: "value"
 
            }).data("kendoComboBox");
function changeItems (){
 data = [
                        { text: "Blue", value: "1" },
                        { text: "Green", value: "2" }
                    ];
//now i want to change the items of my combobox
}
.... and also
<input type="button" value="Change" id="change" onclick="return changeItems();"/>
how can i do without refresh the page???

thanks in advance

No answers yet. Maybe you can help?

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