当前位置: 动力学知识库 > 问答 > 编程问答 >

html - Display on-hover event on UI-Grid

问题描述:

I use http://ui-grid.info/ as below:

<div ncy-breadcrumb class="title-shadow"></div>

{{ getDeviceTree }}

<div>

<div ui-grid="gridOptions" ui-grid-resize-columns ui-grid-selection></div>

</div>

and my goal is to have http://plnkr.co/edit/gKqt8JEo2FukS3URRLJ5?p=preview

Thanks a lot for any hints and/or recommendations of different than UI-grid component.

网友答案:

Luckily ui-grid provides GridOptions for configuring these options. The closest I could get to is this.

in your app.js

myApp.config(function($provide){
      $provide.decorator('GridOptions',function($delegate){
        var gridOptions;
        gridOptions = angular.copy($delegate);
        gridOptions.initialize = function(options) {
          var initOptions;
          initOptions = $delegate.initialize(options);
          initOptions.rowTemplate = '<div ng-click="grid.appScope.fnOne(row)" ng-repeat="col in colContainer.renderedColumns track by col.colDef.name" class="ui-grid-cell mouseover" ui-grid-cell></div>';
          return initOptions;
        };
        return gridOptions;
      });
    });

and then in your css

.mouseover :hover
{
    background: red;
}
分享给朋友:
您可能感兴趣的文章:
随机阅读: