【问题标题】:Cannot change title of Kendo Export to Excel button on toolbar无法更改工具栏上 Kendo Export to Excel 按钮的标题
【发布时间】:2015-12-01 08:02:48
【问题描述】:

我想更改 Kendo Grid 工具栏上“导出到 Excel”按钮的标题,但尽管我尝试了许多不同的建议,但仍然无法更新。怎么改?

<script>
    var grid = $("#grid").kendoGrid({
                toolbar: ["excel"],
                excel: {
                    text: "Test 1", //did not make any sense
                    title: "Test 2", //did not make any sense
                    fileName: "Export.xlsx",
                    filterable: true
                },
                //code omitted for brevity

    }).data("kendoGrid");
</script>

【问题讨论】:

    标签: javascript asp.net-mvc kendo-ui kendo-grid kendo-asp.net-mvc


    【解决方案1】:

    除了在toolbar: [...] 中传递一个字符串之外,您还可以传递一个具有正确属性的对象来调整文本。

    改变:

    toolbar: ["excel"];
    

    toolbar: [{name: 'excel', text: 'custom excel export button'}];
    

    完整示例:

    <script>
        var grid = $("#grid").kendoGrid({
            toolbar: [{name:'excel',text:'custom excel export button'}],
            excel: {
                fileName: "Export.xlsx",
                filterable: true
            },
        }).data("kendoGrid");
    </script>
    

    【讨论】:

    • 完美!.. 非常感谢 :)
    猜你喜欢
    • 1970-01-01
    • 2013-01-30
    • 2021-10-26
    • 2017-06-15
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多