Skip to content
Closed
3 changes: 2 additions & 1 deletion src/classes/grid.js
Original file line number Diff line number Diff line change
Expand Up @@ -842,7 +842,8 @@ var ngGrid = function ($scope, options, sortService, domUtilityService, $filter,
};

$scope.viewportDimHeight = function() {
return Math.max(0, self.rootDim.outerHeight - $scope.topPanelHeight() - $scope.footerRowHeight - 2);
//Return up to 20.000 records to be drawn, no need to find out how many can be visible since all will be if no paging is used
return 20000; //Math.max(0, self.rootDim.outerHeight - $scope.topPanelHeight() - $scope.footerRowHeight - 2);
};
$scope.groupBy = function (col) {
if (self.data.length < 1 || !col.groupable || !col.field) {
Expand Down
32 changes: 29 additions & 3 deletions src/classes/styleProvider.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,40 @@
return { "height": col.headerRowHeight + "px" };
};
$scope.rowStyle = function (row) {
var ret = { "top": row.offsetTop + "px", "height": $scope.rowHeight + "px" };
//Find out highest cell height
var rowHeight = $scope.rowHeight;
var cols = row.elm.context.children.length;
var getRowContentHeight = function (row) {
var height = 0;
angular.element.swap(row, { height: 0, overflow: "scroll" }, function () {
height = row.scrollHeight;
});
return height;
};
//Get highest row size
for (var r = 0; r < cols; r++) {
var newRowContentHeight = getRowContentHeight(row.elm.context.children[r]);
if (rowHeight < newRowContentHeight){
rowHeight = newRowContentHeight;
}
}
//Fix offsetTop of next cell
if (grid.rowCache[row.rowIndex + 1] != null){
grid.rowCache[row.rowIndex + 1].clone.offsetTop = row.offsetTop + rowHeight;
}
else //Fix grid height
{
grid.$viewport[0].style.height = row.offsetTop + rowHeight + 20 + "px";
}
var ret = { "top": row.offsetTop + "px", "height": rowHeight + "px" };
if (row.isAggRow) {
ret.left = row.offsetLeft;
}
return ret;
};
$scope.canvasStyle = function() {
return { "height": grid.maxCanvasHt + "px" };
//Not necessary to set height anymore. All function could be erased
return "";
};
$scope.headerScrollerStyle = function() {
return { "height": grid.config.headerRowHeight + "px" };
Expand All @@ -30,4 +56,4 @@
$scope.footerStyle = function() {
return { "width": grid.rootDim.outerWidth + "px", "height": $scope.footerRowHeight + "px" };
};
};
};
7 changes: 4 additions & 3 deletions src/services/DomUtilityService.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,10 @@
};
domUtilityService.getRealWidth = function (obj) {
var width = 0;
var props = { visibility: "hidden", display: "block" };
var props = { visibility: "hidden", display: "block", position: "absolute" };
var hiddenParents = obj.parents().andSelf().not(':visible');
$.swap(hiddenParents[0], props, function () {
hiddenParents[0].style.setProperty("display", "block", "important");
width = obj.outerWidth();
});
return width;
Expand Down Expand Up @@ -104,7 +105,7 @@
for (var i = 0; i < cols.length; i++) {
var col = cols[i];
if (col.visible !== false) {
css += "." + gridId + " .col" + i + " { width: " + col.width + "px; left: " + sumWidth + "px; height: " + rowHeight + "px }" +
css += "." + gridId + " .col" + i + " { width: " + col.width + "px; left: " + sumWidth + "px; }" +
"." + gridId + " .colt" + i + " { width: " + col.width + "px; }";
sumWidth += col.width;
}
Expand Down Expand Up @@ -146,4 +147,4 @@
domUtilityService.LetterW = 10;
getWidths();
return domUtilityService;
}]);
}]);
14 changes: 7 additions & 7 deletions src/templates/footerTemplate.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,19 +7,19 @@
<span class="ngLabel">{{i18n.ngSelectedItemsLabel}} {{selectedItems.length}}</span>
</div>
</div>
<div class="ngPagerContainer" style="float: right; margin-top: 10px;" ng-show="enablePaging" ng-class="{'ngNoMultiSelect': !multiSelect}">
<div class="ngPagerContainer form-group" style="float: right; margin-top: 10px;" ng-show="enablePaging" ng-class="{'ngNoMultiSelect': !multiSelect}">
<div style="float:left; margin-right: 10px;" class="ngRowCountPicker">
<span style="float: left; margin-top: 3px;" class="ngLabel">{{i18n.ngPageSizeLabel}}</span>
<select style="float: left;height: 27px; width: 100px" ng-model="pagingOptions.pageSize" >
<select class="form-control" style="float: left;height: 27px; width: 70px; font-size: 11px;" ng-model="pagingOptions.pageSize" >
<option ng-repeat="size in pagingOptions.pageSizes">{{size}}</option>
</select>
</div>
<div style="float:left; margin-right: 10px; line-height:25px;" class="ngPagerControl" style="float: left; min-width: 135px;">
<button type="button" class="ngPagerButton" ng-click="pageToFirst()" ng-disabled="cantPageBackward()" title="{{i18n.ngPagerFirstTitle}}"><div class="ngPagerFirstTriangle"><div class="ngPagerFirstBar"></div></div></button>
<button type="button" class="ngPagerButton" ng-click="pageBackward()" ng-disabled="cantPageBackward()" title="{{i18n.ngPagerPrevTitle}}"><div class="ngPagerFirstTriangle ngPagerPrevTriangle"></div></button>
<input class="ngPagerCurrent" min="1" max="{{currentMaxPages}}" type="number" style="width:50px; height: 24px; margin-top: 1px; padding: 0 4px;" ng-model="pagingOptions.currentPage"/>
<button type="button" class="ngPagerButton" ng-click="pageForward()" ng-disabled="cantPageForward()" title="{{i18n.ngPagerNextTitle}}"><div class="ngPagerLastTriangle ngPagerNextTriangle"></div></button>
<button type="button" class="ngPagerButton" ng-click="pageToLast()" ng-disabled="cantPageToLast()" title="{{i18n.ngPagerLastTitle}}"><div class="ngPagerLastTriangle"><div class="ngPagerLastBar"></div></div></button>
<button type="button" class="ngPagerButton btn btn-primary" ng-click="pageToFirst()" ng-disabled="cantPageBackward()" title="{{i18n.ngPagerFirstTitle}}"><div class="ngPagerFirstTriangle"><div class="ngPagerFirstBar"></div></div></button>
<button type="button" class="ngPagerButton btn btn-warning" ng-click="pageBackward()" ng-disabled="cantPageBackward()" title="{{i18n.ngPagerPrevTitle}}"><div class="ngPagerFirstTriangle ngPagerPrevTriangle"></div></button>
<input class="ngPagerCurrent btn btn-default" min="1" max="{{currentMaxPages}}" type="number" style="width:60px; height: 24px; margin-top: 1px; padding: 0 4px;" ng-model="pagingOptions.currentPage"/>
<button type="button" class="ngPagerButton btn btn-warning" ng-click="pageForward()" ng-disabled="cantPageForward()" title="{{i18n.ngPagerNextTitle}}"><div class="ngPagerLastTriangle ngPagerNextTriangle"></div></button>
<button type="button" class="ngPagerButton btn btn-primary" ng-click="pageToLast()" ng-disabled="cantPageToLast()" title="{{i18n.ngPagerLastTitle}}"><div class="ngPagerLastTriangle"><div class="ngPagerLastBar"></div></div></button>
</div>
</div>
</div>