Angular-ui's tooltip does not display correctly in ng-grid

前端 未结 2 1790
死守一世寂寞
死守一世寂寞 2020-12-30 11:32

I\'ve been searching for some time for a solution for displaying a tooltip on ng-grid but with no luck. When I use the cellTemplate on ng-grid for customizing the cell to in

相关标签:
2条回答
  • 2020-12-30 12:17

    You can use

    tooltip-append-to-body="true" 
    

    as documented here (scroll down to tooltip): http://angular-ui.github.io/bootstrap/

    Here is the plunker: http://plnkr.co/edit/nHN2p8qMjT7ZTwpXgJoO?p=preview

    0 讨论(0)
  • 2020-12-30 12:24

    As I commented, this is a known issue inside an ng-grid cell. I fixed this by setting cellClass in the column definition to this:

    cellClass: 'cellToolTip'
    

    And the css:

    .cellToolTip {
        overflow: visible;
    }
    

    Here is a plunker that shows the tooltip. However, the tooltip is not positioned exactly right. :)

    EDIT: Adding this to the .tooltip style fixed the positioning problem, but I'm not sure why in Plunker I had to do this. In my own code, this was not necessary:

    .tooltip {
      top: 0 !important;
    }
    

    Here is a new plunker that is working.

    0 讨论(0)
提交回复
热议问题