有没有办法在特定行的鼠标悬停时在有角度的ui网格中显示按钮? [英] Is there a way to display button in the angular ui-grid on mouseover on that particular row?

查看:102
本文介绍了有没有办法在特定行的鼠标悬停时在有角度的ui网格中显示按钮?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的angularjs ui-grid中有按钮,但是这些按钮只能在特定行上的鼠标悬停时显示.任何想法将不胜感激.

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.

推荐答案

,您需要添加rowTemplate并在模板中添加ng-mouseenter =" grid.appScope.rowHover(row)". mouseleave也是如此

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

这是代码:

    $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;      
    }

};

这篇关于有没有办法在特定行的鼠标悬停时在有角度的ui网格中显示按钮?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆