Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Tooltip property for column header ui-grid angularjs

I am using cellTooltip property of colDef but that does not seems to be working.

$scope.gridOptions.columnDefs = [{ displayName: 'Test', field: '_test', 
    cellTooltip: function (row, col) { return row.entity._Number },
    cellTemplate: '<div class="ui-grid-cell-contents" title="{{row.entity._Number}}"></div>'},
];

Any help would be appreciated.

like image 852
Surendra Mourya Avatar asked Nov 22 '16 10:11

Surendra Mourya


People also ask

How to add tooltip in angular grid?

You can add a tooltip to the column header simply by adding headerTooltip: 'Custom header string' in the column definition. Save this answer.

How to add tooltip in ag grid column angular?

When we want to display a header tooltip, we set the headerTooltip config as a string , and that string will be displayed as the tooltip. However, when working with custom tooltips we set colDef. tooltipComponent to assign the column's tooltip component and the headerTooltip value will passed to the params object.

How to show tooltip in ag grid header?

Default Browser Tooltip If you don't want to use the grid's tooltip component, you can use the enableBrowserTooltips config to use the browser's default tooltip. The grid will simply set an element's title attribute to display the tooltip.

What is grid in AngularJS?

UI-Grid 3.0 (formerly ng-grid) is a 100% Angular grid written with no dependencies other than AngularJS. It is designed around a core grid module and features are layered as Angular modules and Directives. This keeps the core; small and focused, while executing very complex features only when you need them.


2 Answers

You can add a tooltip to the column header simply by adding headerTooltip: 'Custom header string' in the column definition.

https://github.com/angular-ui/ui-grid/issues/3118

like image 112
Homer Avatar answered Nov 04 '22 20:11

Homer


For header tooltip in ui-grid there is headerCellTemplate property available. This worked for me.

headerCellTemplate: '<div class="ui-grid-cell-contents ui-grid-header-cell-primary-focus"><span class="ui-grid-header-cell-label ng-binding" title="Test">Test</span></div>'
like image 44
Surendra Mourya Avatar answered Nov 04 '22 21:11

Surendra Mourya