【问题标题】:how to take input fields from reactive form and display it on Ag-Grid [closed]如何从反应表单中获取输入字段并将其显示在 Ag-Grid [关闭]
【发布时间】:2022-08-23 18:35:23
【问题描述】:

我只是在做一个关于 Angular Reactive 表单的基本项目。我想从表单中获取输入并显示在 Ag 网格上。

enter image description here

正如您在这张图片中看到的,我使用简单的 html 表来显示数据,现在我想在 Ag 网格上获取这些数据

    标签: angular angular-reactive-forms


    【解决方案1】:

    如果您使用的是表单组,您只需在 addButton 上添加(单击),并具有处理新数据的功能。

    const newData = this.form.value // prepare the data acording to whatever ag grid needs
    this.gridData = [newData, ...this.gridData]
    

    【讨论】:

      猜你喜欢
      • 2020-08-17
      • 2017-04-11
      • 2018-06-12
      • 1970-01-01
      • 2017-12-06
      • 2020-05-23
      • 1970-01-01
      • 1970-01-01
      • 2019-08-19
      相关资源
      最近更新 更多