Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion demo/bootstrap/js/demoApp.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@ angular.module('myApp', ['ui.bootstrap', 'dataGrid', 'pagination'])

$scope.gridOptions = {
data: [],
urlSync: true
urlSync: true,
customStyle: "item.total.value>1000 ? '' : 'trBack'"
};

myAppFactory.getData().then(function (responseData) {
Expand Down
6 changes: 5 additions & 1 deletion dist/dataGrid.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
$scope.paginationOptions = angular.copy($scope.defaultsPaginationOptions);
$scope.sortOptions = $scope._gridOptions.sort ? angular.copy($scope._gridOptions.sort) : {};
$scope.customFilters = $scope._gridOptions.customFilters ? angular.copy($scope._gridOptions.customFilters) : {};
$scope.customStyle = $scope._gridOptions.customStyle ? angular.copy($scope._gridOptions.customStyle) : false; //Implement css class to change row style
$scope.urlSync = $scope._gridOptions.urlSync;

$scope.$watchCollection('_gridOptions.data', function (newValue) {
Expand Down Expand Up @@ -301,6 +302,9 @@
} else {
element.attr('ng-repeat', "item in filtered | startFrom:(paginationOptions.currentPage-1)*paginationOptions.itemsPerPage | limitTo:paginationOptions.itemsPerPage track by $index");
}
if ($scope.customStyle) {
element.attr('ng-class', $scope.customStyle);
}
element.removeAttr('grid-item');
var html = element[0].outerHTML;
element.replaceWith($compile(html)($scope));
Expand Down Expand Up @@ -444,4 +448,4 @@
});
}
}
})();
})();