【问题标题】:How to implement Master-Detail component in the community edition of the ag-grid如何在 ag-grid 的社区版中实现 Master-Detail 组件
【发布时间】:2019-06-11 07:10:05
【问题描述】:

我想实现 ag-grid Master Detail 功能。但是它是一个企业级功能,我目前正在使用社区版本,由于某些限制,我的组织不想购买许可证。有没有其他方法可以实现这个?先谢谢你了。

【问题讨论】:

    标签: angularjs ag-grid-angular


    【解决方案1】:

    尝试将此选项添加到您的 colDef:

    gridOptions= {
       fullWidthCellRendererFramework: RowDetailsRendererComponent,
       isFullWidthCell: (rowNode: RowNode) => rowNode.flower,
       doesDataFlower: (data: any) => true,
       embedFullWidthRows: true
    }
    

    RowDetailsRendererComponent 必须实现 AgRendererComponent 类的地方

    例如必须包含子 ag-grid

    @Component({
      template: '<ag-grid ...></ag-grid>' // child grid
    })
    export class RowDetailsRendererComponent implements AgRendererComponent {
      agInit(params): void {}
      refresh(params: any): boolean {}
    }
    

    【讨论】:

    【解决方案2】:

    此代码允许您用组件的内容替换一行。在我看来,最初问题的解决方案可能是将此代码与“frameworkComponent”一起使用来实现展开/折叠按钮。您可以在此处查看如何使用向 ag-Grid 添加按钮: Example to add a botton to a cell in ag-Grid

    【讨论】:

      猜你喜欢
      • 2018-03-21
      • 2020-11-04
      • 2021-08-09
      • 2023-03-23
      • 1970-01-01
      • 2021-05-02
      • 1970-01-01
      • 2019-11-10
      • 2011-08-08
      相关资源
      最近更新 更多