无法在工具栏上更改Kendo Export to Excel按钮的标题

Jac*_*ack 2 javascript asp.net-mvc kendo-ui kendo-grid kendo-asp.net-mvc

我想更改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>
Run Code Online (Sandbox Code Playgroud)

Gen*_*e R 6

toolbar: [...]您可以传递一个具有正确属性的对象来调整文本,而不仅仅是传递一个字符串.

更改:

toolbar: ["excel"];
Run Code Online (Sandbox Code Playgroud)

toolbar: [{name: 'excel', text: 'custom excel export button'}];
Run Code Online (Sandbox Code Playgroud)

完整的例子:

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