简体   繁体   中英

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

示例图像

how to achieve the above functionality with ag-grid.

i have tried using menuIcon inside the column array.

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.

use it this way

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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