What is the best way of doing local binding of a DropDownList (or ComboBox) to a cached JSON array, e.g. a collection of data items cached in localStorage?
1 Answer, 1 is accepted
0
Petur Subev
Telerik team
answered on 29 Aug 2014, 11:02 AM
Hello,
You have several options pretty much equivalent to do this.
var localStorageItems = // get the items or parse them however the logic is
//option 1
var dataSource = localStorageItems ;
//option 2
var dataSource = {
data: localStorageItems
};
//option 3
var dataSource = {
transport: {
read: function(e) {
e.success(localStorageItems);
}
}
};
$("#myDropDOwnList).kendoDropDownList({
dataSource: dataSource
//other options
});
Even more examples are available in the documentation here: