grid - Kendo UI Grid 导出到 Excel/PDF 不适用于 IE9

标签 grid internet-explorer-9 export

我在 IE9 中将 Kendo UI Grid 导出为 excel 和 pdf 时遇到问题。
Everythig 使用 Chrome 运行良好,但在 IE9 中没有任何 react 。
这是我的网格。有什么不妥或遗漏吗?

        $("#gridDetalhes").kendoGrid({

            dataSource: {
                data: myJsonList
            },


            excel: {
                allPages: true,
                fileName: "SGD_Detalhes.xlsx"
            },


            toolbar: ["excel", "pdf"],


            columns: [


                   { field: "DataInicio", width: "135px", title: "Início", type: "date", template: '#= kendo.toString(DataInicio,"dd/MM/yyyy HH:mm:ss") #' },
                   { field: "DataFim", width: "135px", title: "Fim", type: "date", template: '#= kendo.toString(DataFim,"dd/MM/yyyy HH:mm:ss") #' },
                   { field: "Duracao", width: "80px", title: "Duração", type: "string" },
                   { field: "Gerador", width: "40px", title: "A/M", type: "string" },
                   { field: "Identificador", width: "120px", title: "Identificador", type: "string" },

            ]


        });

最佳答案

导出功能不支持Safari、IE9及以下。
对于不受支持的浏览器,您需要提供 proxyUrl指定服务器代理 URL。

查看 Server Proxy Implementations 的示例(适用于 ASP.NET WebForms/API/MVC、PHP、Java/Spring MVC)

例如 - ASP.NET MVC 的服务器 Controller 操作:

public class HomeController
{
    [HttpPost]
    public ActionResult KendoSave(string contentType, string base64, string fileName)
    {
        var fileContents = Convert.FromBase64String(base64);

        return File(fileContents, contentType, fileName);
    }
}

然后您需要提供指向此操作的 proxyUrl 参数:
excel: {
                allPages: true,
                fileName: "SGD_Detalhes.xlsx"
                proxyURL: "/Home/KendoSave",
       }

希望能帮助到你。

关于grid - Kendo UI Grid 导出到 Excel/PDF 不适用于 IE9,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/27784824/

相关文章:

wpf - 如何将网格设置为 Items 控件的模板?

html - 无法制作 2x2 图像网格 [CSS]

javascript - 调试 javascript 和 console.log 不起作用

jquery - 是什么导致了 Internet Explorer 9 中的空白

mysql - 出现 1045 错误时,如何在 SQL 中导出运行查询的结果?

sql-server-2000 - 让 bcp.exe 转义终止符

r - 动态轴在绘图区域的顶部和底部滴答作响,循环时具有一致的间隔数和一致的宽度(ggplot2、grid.arrange)

asp.net-mvc - Telerik Grid MVC 并选中所有页面上的所有复选框

css - 各种元素的字体大小很小 IE9

perl - Perl Net::SSH::Perl不加载我的环境变量与通过SSH连接