Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to make the search icon permanently visible in the column in ag-grid?

I want to make the filter icon visible permanently in the Ag-grid. The current behaviour is such that the filter icons in the columns only become visible when I hover across the column headings .

This is an example of the column definition that I am using.

this.ColumnDefs=[{"headerName":"Interface","field":"interfaceName",sortingOrder: ['asc','desc', 'null'],width:120,cellStyle:{'text-align': "left"},unSortIcon: true},
{"headerName":"Status","field":"status",sortingOrder: ['asc','desc', 'null'],width:120,cellStyle:{'text-align': "left"},unSortIcon: true},
{"headerName":"Runtime","field":"lastDate",sortingOrder: ['asc','desc', 'null'],width:150,cellStyle:{'text-align': "left"},unSortIcon: true}]

How can I achieve this result?

like image 418
Ashutosh Kumar Avatar asked Apr 01 '19 06:04

Ashutosh Kumar


People also ask

How do I turn off the filter icon on Ag grid?

gridOptions = { floatingFilter: true columnDefs:[{ ... suppressMenu: true, floatingFilterComponentParams: {suppressFilterButton:true} ... }] } Save this answer.

How do I change the sort icon on Ag grid?

You can use the icons property of the column definition to set a custom icon for sort on a column level or icons property of gridOptions to apply for all columns. If defined in both the grid options and column definitions, the column definition will get used. Also you must import fontawesome css file for this to work.

How do you fix a column position on Ag grid?

You can pin columns by setting the pinned attribute on the column definition to either 'left' or 'right' .


1 Answers

The correct answer is here to set suppressMenuHide in gridOptions or directly on HTML [suppressMenuHide]="true"

suppressMenuHide Set to true to always show the column menu button, rather than only showing when the mouse is over the column header.

like image 149
un.spike Avatar answered Oct 26 '22 02:10

un.spike