代码之家  ›  专栏  ›  技术社区  ›  sylar12

agGrid Angular-在行、列上添加元素(图标)

  •  0
  • sylar12  · 技术社区  · 7 年前

    https://imgur.com/a/IU5JlbN “示例”

    2 回复  |  直到 7 年前
        1
  •  5
  •   Pratik Bhat    7 年前

    您应该在网格中使用列def创建一个新字段,如下所示-

    {
        headerName: "",
        field: "icon",
        width: 100,
        cellRenderer: function(params) {
            return '<span><i class="fa fa-trash"></i></span>';
        }
    }  
    


    但是,如果希望图标响应事件或执行操作,则应研究如何实现单元渲染器组件,如前所述 here .

        2
  •  0
  •   Christophe Chenel    7 年前

    然后转到您的css:

    cellStyle: { 'justify-content': "flex-end" }
    

    cellStyle: {textAlign: "right"}
    
    推荐文章