关于第一个问题,在 2015 年第二季度,Kendo 团队在小部件初始化中引入了一个突破性的变化,现在它是同步发生的,不像以前是异步的。更多细节可以在他们的文档中找到:
http://docs.telerik.com/kendo-ui/AngularJS/Troubleshooting/common-issues#angularjs-templates-are-not-evaluated-before-widget-initialization
简而言之,您需要避免使用包含“{{ }}”Angular 模板的 HTML 属性。解决方案是构建一个具有更高优先级的自定义指令,该指令将在初始化 Kendo 小部件之前评估模板。
至于第二个问题,组件的选择行为在 2015 年第一季度发生了变化,以更好地匹配 HTML Select 的工作方式。更多详细信息和可能的解决方法再次正确记录在以下Breaking Changes
部分中:
http://docs.telerik.com/kendo-ui/backwards-compatibility/2015-backward-compatibility#changes-from-2014-q3-sp2-201431411
<input id="dropdownlist" />
<script>
var widget = $("#dropdownlist").kendoDropDownList({
dataSource: ["foo1", "foo2"]
});
widget.value(""); //this will clear selection
if (widget.select() == -1) { //if value does not exist, select first one
widget.select(0);
}
</script>
Check the DropDownList
section for more details.