简体   繁体   English

如何在 ag-grid 列标题中添加图标?

[英]How to add icon in ag-grid column header?

i have develop an ag-grid tabel and on the table header column i wanted to add an icon just beside the header name, as shown in below image我开发了一个 ag-grid 表格,在表格标题列上,我想在标题名称旁边添加一个图标,如下图所示

示例图像

how to achieve the above functionality with ag-grid.如何使用 ag-grid 实现上述功能。

i have tried using menuIcon inside the column array.我尝试在列数组中使用 menuIcon 。

const columns = [
    {
        autoHeight: true
        sortingOrder: ["desc", "asc", null],
        minWidth: 200,
        width: 200,
        headerComponentParams : {
            // hear i have tried to use menuIcon
        }
    }]

but not able to place the icon there, looking for the solution how to add icon in the ag-grid header column.但无法将图标放在那里,正在寻找如何在 ag-grid 标题列中添加图标的解决方案。

use it this way以这种方式使用它

{
     headerName: '',
     headerComponentParams: { template: `
                                   <div>
                                       <span>
                                         sample <i class="fa fa-star"> 
                                                </i>
                                        </span>
                                   </div>`},
     field: "bookmarked",
     minWidth: 200,
     width: 200,
}

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM