【问题标题】:Can we use custom cell editor as similar of "agLargeTextCellEditor"?我们可以使用类似于“agLargeTextCellEditor”的自定义单元格编辑器吗?
【发布时间】:2020-07-29 21:22:38
【问题描述】:

我已将这些代码行用于地址标题列中的附加图像文本区域。

      ````````
           "headerName: "Address",
            field: "Address",
            width: 350,
           **cellEditor: 'agLargeTextCellEditor'**

    ````````````

但“agLargeTextCellEditor”的限制是它只接受 200 个字符。但我的要求是最多 500 个字符。那么我们可以在 ag-grid 中使用任何自定义单元格编辑器吗?或任何替代解决方案?

注意:我知道你们中的一些人会建议我使用“agRichSelectCellEditor”,但它仅在 ag-Grid Enterprise 中可用,所以我不能使用它。

更多信息请参考https://www.ag-grid.com/javascript-grid-provided-cell-editors/#agtextcelleditor-agpopuptextcelleditor

【问题讨论】:

    标签: angular7 ag-grid ag-grid-angular


    【解决方案1】:

    agLargeTextCellEditor 的文档说字符数以及行数和列数是可配置的。默认的“maxLength”为 200,但您可以提供自己的值。

    我还没有尝试过,但是从文档来看,您应该将 columnDef 修改为如下所示:

    {
       headerName: 'Address',
       field: 'Address',
       width: 350,
       cellEditor: 'agLargeTextCellEditor'
       cellEditorParams: {maxLength: 500}
    }
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2022-01-08
      • 1970-01-01
      • 2021-02-12
      • 1970-01-01
      • 1970-01-01
      • 2012-08-05
      • 2011-12-16
      相关资源
      最近更新 更多