2

I want to put a custom property in $scope.gridOptions.columnDefs, e.g:

$scope.gridOptions.columnDefs = [
    {
        field: 'field',
        displayName: 'Name Field',
        cellFilter: 'nameField',
        headerCellTemplate: '../header-cell-template.html',
        customProperty: 'some text for tooltip'
    },
    {
       ...
    }
]

then, in the headerCellTemplate i'm using uib-tooltip:

    <div role="columnheader">
    ....
    <span class="ui-grid-header-cell-label">
    {{col.displayName}}
    </span>
    <span class="icon" uib-toolotp='{{col.customProperty}}' tooltip-placement='right'></span>//it's not working, col.customProperty = underfined, but working if expression {{col.displayName}}
    ....
    </div>

what is the other working way to put text to template?

rossoneri
  • 443
  • 5
  • 17
  • columnDefs includes a headerTootip property that you can set in order to display the display name. Will that not do? – Matt M Jun 24 '16 at 14:01
  • it allowed to show ui-grids tooltip, when hover on the cell. I wont to add some icon in cell and tooltip must be showed only on hover on this icon, that i using uib-tooltip with custom template, but i don't know how to put description to uib-toolotp in headerCellTemplate. – rossoneri Jun 24 '16 at 14:20

1 Answers1

1

Each cell has col.colDef property with access to all properties like field, displayName, tooltipDescription etc.

rossoneri
  • 443
  • 5
  • 17