admin管理员组

文章数量:1419168

I want to change the title of the "Export to Excel" button on Kendo Grid's toolbar, but although I tried to apply many different suggestions, still cannot update. How to change this?

<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>

I want to change the title of the "Export to Excel" button on Kendo Grid's toolbar, but although I tried to apply many different suggestions, still cannot update. How to change this?

<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>
Share Improve this question edited Dec 1, 2015 at 8:22 Jack asked Dec 1, 2015 at 8:02 JackJack 1
Add a ment  | 

1 Answer 1

Reset to default 7

Instead of just passing a string in the toolbar: [...] you can pass an object which with the right property will adjust the text.

change:

toolbar: ["excel"];

to

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

full example:

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

本文标签: javascriptCannot change title of Kendo Export to Excel button on toolbarStack Overflow