如何在 Kendo UI TreeList 中动态更改列标题?

How to change column title dynamically in Kendo UI TreeList?

我需要根据数据更改列header/title。有什么办法可以实现这个功能吗

目前标题硬编码如下:

        $("#grid").kendoTreeList({
            dataSource: drillDownDataSource,
            resizable: true,
            autoBind: true,
            columns: [
                { field: "Title", title: " ", width: "297px" },
                { field: "EndingBalance",  title: "EndingBalance",  template: "#: FormatNumberToEn(EndingBalance) #" },
                { field: "EndingBalance1", title: "EndingBalance1", template: "#: FormatNumberToEn(EndingBalance1) #" },
                { field: "EndingBalance2", title: "EndingBalance2", template: "#: FormatNumberToEn(EndingBalance2) #" },
                { field: "EndingBalance3", title: "EndingBalance3", template: "#: FormatNumberToEn(EndingBalance3) #" },
                { field: "EndingBalance4", title: "EndingBalance4", template: "#: FormatNumberToEn(EndingBalance4) #" }
            ],
            dataBound: function (e) {
                $('#grid').show();
                $('#GridPanelLoading').hide();
            },

Demo

1- 使用 headerTemplate

$("#treelist").kendoTreeList({
        columns: [ {
            field: "name",
            headerTemplate: '#= getHeader() #'
        }],
...

2- 或将 header 列更改为 jQuery

$("#treelist thead [data-field=name]").html("New Title")