kendo ui select a specifix index/text during first load

大兔子大兔子 提交于 2019-12-04 10:16:43

Get a reference to the dropdown list

var dropdownlist = $("#Instrument").data("kendoDropDownList");

If you know the index you can use:

// selects by index
dropdownlist.select(1);

If not, use:

// selects item if its text is equal to "test" using predicate function
dropdownlist.select(function(dataItem) {
    return dataItem.symbol === "test";
});

check this http://jsfiddle.net/OnaBai/mRmNJ/

See Kendo Documentation

I believe in your case it would be some call like so:

//trigger the select of combobox 
cmb.select(function(dataItem) {
    return dataItem.text === theme;
});

Or just set the value property in the object initializer

value = ($.cookie('selectedTheme') || "default").toLowerCase(),
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!