Is there a way to display button in the angular ui-grid on mouseover on that particular row?

一笑奈何 提交于 2019-12-25 03:21:19

问题


I have buttons in my angularjs ui-grid.But, those must be displayed only on mouseover on that particular row.I tried many things with cell template.But, not successful in doing it. Any ideas will be appreciated.


回答1:


you need to add a rowTemplate and have ng-mouseenter="grid.appScope.rowHover(row)" in the template. So is mouseleave

here is code:

    $scope.gridOptions.gridOptions: {        
       rowTemplate: ' <div ng-repeat="col in colContainer.renderedColumns track by col.colDef.name" class="ui-grid-cell" ui-grid-cell ng-mouseenter="**grid.appScope.rowHover(row)**" ></div>',        

    columnDefs: [ 
      { field: 'status', displayName: 'Status', width: 80 },
      { field: 'to.name', displayName: 'Assignee', width: 200 }   
    ]           
}

      $scope.gridOptions.appScopeProvider= {
   rowHover: function(row) {
    $scope.row= row.entity;      
    }

};



来源:https://stackoverflow.com/questions/28626553/is-there-a-way-to-display-button-in-the-angular-ui-grid-on-mouseover-on-that-par

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!