1

我想更改Kendo Grid工具栏上的“导出到Excel”按钮的标题,但尽管我尝试应用许多不同的建议,但仍无法更新。如何改变这一点?不能更改Kendo导出到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> 

回答

4

而不只是传递一个字符串中的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> 
+0

完美..感谢了很多:) –