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

Best way to rebind data?

1 Answer 129 Views
ComboBox
This is a migrated thread and some comments may be shown as answers.
Pierre
Top achievements
Rank 1
Pierre asked on 17 Apr 2013, 08:34 PM
Hi, 
I currently run some test to see if we can use Telerik Kendo Web on a very specific application. 

The programmers team need to send data to Telerik control without to many Framework UI "Black Box".  Its ok for him to rebind manually the date when a particular event come.

When we create the control:
$("#cboListe").kendoComboBox({
    dataTextField: "Nom",
    dataValueField: "Id",
    dataSource: Module.Collection,
    filter: "contains",
    suggest: true,
    index: 1
});
Module.Collection connait a lits of object. After the creation, what is the best way to refresh the combobox manually? I can recall the kendoComboBox function and recreate the combobox, but that cause a small visual glitch.

Any suggestion?

1 Answer, 1 is accepted

Sort by
0
Alexander Valchev
Telerik team
answered on 18 Apr 2013, 02:56 PM
Hi Pierre,

Recreating the widget is not supported and will certainly cause issues. Please use the DataSource API methods instead. For example you can replace the ComboBox' list of objects through the data method. Add, insert and remove methods will allow you to add or remove single data items.

Alternatively you may use the setDataSource method of the widget to completely rebind it.

Kind regards,
Alexander Valchev
the Telerik team
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
Tags
ComboBox
Asked by
Pierre
Top achievements
Rank 1
Answers by
Alexander Valchev
Telerik team
Share this question
or