of class 不适用于 of-table
Ng class not working for ng-table
I want to change background color of table row after selecting it. It works well for normal table. When i tried it to ng-table then only few styles are applied from ng-class not all styles are managed to apply including background color.
My [enter link description here][1].
[1]: http://plnkr.co/edit/O6PzlHXEhOyheNS8BbAT?p=preview
我在上面给出了它的工作示例link,
这里 ng class 用于使行内容的字体变粗但不更改行的背景。
尽量避免在筛选列表中使用 $index。试试这个:
<tr ng-repeat="user in userLocations" ng-class="{'selected':user.selected}" ng-dblclick="deselectAll(); user.selected = true;">
$scope.deselectAll = function(){
for(var i; i < userLocations.length i++;){
userLocations[i].selected = false;
}
}
问题不在于 ng-table。事实上问题是 class "table-striped" inside
"<table id="t1" ng-table="tableParams" show-filter="true" class="table table-condensed table-bordered table-striped">"
如果删除 "table-striped",它会正常工作。
要深入了解如何在 bootstrap css 上覆盖自定义 css,您可以按照以下 link 进行操作。此 link 仅针对此问题。
custom css being overridden by bootstrap css
""
希望对您有所帮助。
I want to change background color of table row after selecting it. It works well for normal table. When i tried it to ng-table then only few styles are applied from ng-class not all styles are managed to apply including background color.
My [enter link description here][1].
[1]: http://plnkr.co/edit/O6PzlHXEhOyheNS8BbAT?p=preview
我在上面给出了它的工作示例link, 这里 ng class 用于使行内容的字体变粗但不更改行的背景。
尽量避免在筛选列表中使用 $index。试试这个:
<tr ng-repeat="user in userLocations" ng-class="{'selected':user.selected}" ng-dblclick="deselectAll(); user.selected = true;">
$scope.deselectAll = function(){
for(var i; i < userLocations.length i++;){
userLocations[i].selected = false;
}
}
问题不在于 ng-table。事实上问题是 class "table-striped" inside
"<table id="t1" ng-table="tableParams" show-filter="true" class="table table-condensed table-bordered table-striped">"
如果删除 "table-striped",它会正常工作。
要深入了解如何在 bootstrap css 上覆盖自定义 css,您可以按照以下 link 进行操作。此 link 仅针对此问题。
custom css being overridden by bootstrap css
""
希望对您有所帮助。