【问题标题】:Is there a way to export ag-grid to excel ignoring the grouping on rows(grouping on a single column)?有没有办法将 ag-grid 导出到 excel 忽略行上的分组(在单列上分组)?
【发布时间】:2021-04-22 20:23:12
【问题描述】:

有没有办法将 ag-grid 导出到 excel 中忽略行上的分组(在单列上分组)?

我从 API 接收数据,并通过在单个列上分组来显示它。但是在将其导出到 excel 时,我希望原始数据能够生成 excel。在 ag-agid 中是否有可能/当前可用的方法?

【问题讨论】:

    标签: reactjs excel ag-grid ag-grid-react


    【解决方案1】:

    在导出参数上将属性skipGroups(参见here)设置为true

    Demo.

    【讨论】:

    • 谢谢,但实际上我正在使用 -- { headerName: "name", field: "name", rowGroup: true, hide: true, },直接在名称列上分组而不是显示一个额外的列作为组。使用skipGroups:true时,它显示名称列为空,这很糟糕,我想获取原始json数据,如格式来创建excel(没有任何分组)。
    • 在导出时将属性 allColumns 设置为 true(请参阅我的回答中的文档)。
    猜你喜欢
    • 2021-01-13
    • 2019-07-26
    • 2018-10-24
    • 2020-05-29
    • 2018-12-30
    • 1970-01-01
    • 1970-01-01
    • 2020-04-17
    • 1970-01-01
    相关资源
    最近更新 更多