【问题标题】:Export excel/csv not working in SPFx with ag-grid使用 ag-grid 导出 excel/csv 在 SPFx 中不起作用
【发布时间】:2021-04-22 07:13:13
【问题描述】:

我在 SharePoint 中为 SPFx 使用 ag-grid react。

当我尝试在工作台中导出文件时,它工作正常。但是当我在 sharepoint 中部署 sppkg 包时,导出不起作用。 Blob URL 正在替换 SPFx 页面并显示 404 not found -

https://mytenant.sharepoint.com/sites/mysite/blob:/12012f34-cfb2-45a0-b8dd-539d39272848

调查这个问题的唯一区别是我在工作台中发现的唯一区别是使用以下代码进行下载 -

element.dispatchEvent(new MouseEvent('click', {
                bubbles: false,
                cancelable: true,
                view: window
}));

在部署的代码版本中它不起作用。

任何帮助将不胜感激。

提前致谢!

【问题讨论】:

    标签: sharepoint ag-grid spfx


    【解决方案1】:

    我查看了 ag-grid react 的 doc 并有以下演示,它在我的 SPO 页面上运行良好。

    Excel 导出仅在 ag-Grid Enterprise 中可用(您需要许可证才能使用):

    BR

    【讨论】:

    • 这在工作台上完美运行。但是当我部署它时,就会出现 404 错误。它在浏览器中打开 blob url 而不是下载。
    猜你喜欢
    • 2018-09-27
    • 2020-06-11
    • 2021-02-09
    • 2020-02-04
    • 2016-07-21
    • 1970-01-01
    • 2018-12-21
    • 1970-01-01
    • 2019-01-21
    相关资源
    最近更新 更多