如何通过单元格模板将类添加到选择按钮单元格的最高父div?我需要使用ui-grid-row类为div添加额外的类名。
我有
.ui-grid-row:nth-child(odd):hover .ui-grid-cell{background:rgb(187,210,157) none repeat scroll 0% 0% }
.ui-grid-row:nth-child(even):hover .ui-grid-cell{background:rgb(187,210,157) none repeat scroll 0% 0% }
在我的css文件中,我不想悬停选择按钮单元格。
<div ng-style="Viewport.rowStyle(rowRenderIndex)" class="ui-grid-row ng-scope" ng-repeat="(rowRenderIndex, row) in rowContainer.renderedRows track by $index" ng-class="{'ui-grid-row-selected': row.isSelected}">
<div row-render-index="rowRenderIndex" ui-grid-row="row" role="row" class="ng-isolate-scope">
<!-- ngRepeat: (colRenderIndex, col) in colContainer.renderedColumns track by col.uid -->
<div ui-grid-cell="" role="rowheader" ng-class="{ 'ui-grid-row-header-cell': col.isRowHeader }" class="ui-grid-cell ng-scope ui-grid-coluiGrid-0005 ui-grid-row-header-cell" ui-grid-one-bind-id-grid="rowRenderIndex + '-' + col.uid + '-cell'" ng-repeat="(colRenderIndex, col) in colContainer.renderedColumns track by col.uid" id="1444720102515-7-uiGrid-0005-cell">
<div class="ui-grid-disable-selection ng-scope">
<div class="ui-grid-cell-contents">
<div ng-click="selectButtonClick(row, $event)" ng-class="{'ui-grid-row-selected': row.isSelected}" class="ui-grid-selection-row-header-buttons ui-grid-icon-ok ng-scope">
</div>
</div>
</div>
</div>
<!-- end ngRepeat: (colRenderIndex, col) in colContainer.renderedColumns track by col.uid -->
</div>
</div>
答案 0 :(得分:1)
.ui-grid-render-container-body .ui-grid-row:nth-child(odd):hover .ui-grid-cell{background:rgb(187,210,157) none repeat scroll 0% 0% }
.ui-grid-render-container-body .ui-grid-row:nth-child(even):hover .ui-grid-cell {background:rgb(187,210,157) none repeat scroll 0% 0% }