kendo-ui - 无法展开 Kendo TreeView 中的所有节点

标签 kendo-ui expand kendo-treeview

我想一直显示我的 Kendo UI TreeView 展开,但它只会显示折叠。重新加载数据源时,我可以看到展开树的一闪而过,但随后它崩溃了。

var locationTreeView = $("#treeViewLocations").kendoTreeView({
checkboxes: {
    checkChildren: false,
    template: "# if(item.showCheckbox){# <input type='checkbox' name='selectedLocations' value='#= item.value #' />#}#"
},
dataTextField: "text",
dataSource: {
    transport: {
        read: {
            url: window.location.origin + "/api/v1/bookingrequestlocation",
            dataType: "json",
            type: "GET",
            data: { bookingSeasonPeriodId: bookingSeasonPeriod.value() },
        }
    },
    schema: {
        model: {
            id: "value",
            children: "items",
            hasChildren: "hasChildren",
        }
    }
}}).data("kendoTreeView");

expandTreeView();

function changeSeason() {
    locationTreeView.dataSource.read();
    expandTreeView();}

function expandTreeView() {
    locationTreeView.expand(".k-item");}

最佳答案

在数据绑定(bind)事件中触发 expandTreeView() 函数

关于kendo-ui - 无法展开 Kendo TreeView 中的所有节点,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/21599941/

相关文章:

java - 如何在 Spring Requestmapping 中将日期作为对象参数发布

eclipse - 有没有办法展开 Eclipse 项目 View 和搜索结果中的所有文件夹?

kendo-ui - 过滤kendoTreeList中重复记录的数据

javascript - 如何修改 Kendo UI Grid 中的 Filter?

kendo-ui - Kendo UI Timepicker 自定义间隔格式

javascript - 使用有条件禁用的控件进行内联编辑

css - 子 div 在同一行上使用 css 扩展到父 div 的全宽大小

javascript - RxJS 展开在一定数量的调用后不会完成。它有限制吗?

javascript - Kendo UI 树复选框选中和取消选中 angular 中的事件

asp.net-mvc - Asp.Net MVC Core Telerik TreeView 文本显示为未定义