gpt4 book ai didi

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

转载 作者:行者123 更新时间:2023-12-01 01:06:31 26 4
gpt4 key购买 nike

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

当前标题硬编码如下:

        $("#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-或通过 jQuery 更改列标题

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

关于jquery - 如何在 Kendo UI TreeList 中动态更改列标题?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/37253385/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com