How to modify KendoUI DropDownList items

徘徊边缘 提交于 2019-11-30 19:08:47

Yo mate

You should use the dataSource of the combobox. e.g.

var ds = $('#YourCombo').data().kendoComboBox.dataSource;

then you can modify the items like this

//someIndex is the index of the item in the dataSource
ds.data()[someIndex].set("text","Cool! its changed");

to add item or remove use the add and remove methods of the dataSource

ds.add({text:"Test again!",value:"5"});
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!