Skip to content
Browse files

Fix #395 - options.leaveSpaceForNewRows doesn't make sense when optio…

…ns.autoHeight is on.
  • Loading branch information...
1 parent fd2ee1e commit 0b69e8abbdacb2e98ca574fbe8e543bf6bec6924 @mleibman committed
Showing with 9 additions and 1 deletion.
  1. +9 −1 slick.grid.js
View
10 slick.grid.js
@@ -186,6 +186,7 @@ if (typeof Slick === "undefined") {
scrollbarDimensions = scrollbarDimensions || measureScrollbar();
options = $.extend({}, defaults, options);
+ validateAndEnforceOptions();
columnDefaults.width = options.defaultColumnWidth;
columnsById = {};
@@ -1183,11 +1184,18 @@ if (typeof Slick === "undefined") {
}
options = $.extend(options, args);
+ validateAndEnforceOptions();
$viewport.css("overflow-y", options.autoHeight ? "hidden" : "auto");
render();
}
+ function validateAndEnforceOptions() {
+ if (options.autoHeight) {
+ options.leaveSpaceForNewRows = false;
+ }
+ }
+
function setData(newData, scrollToTop) {
data = newData;
invalidateAllRows();
@@ -1497,7 +1505,7 @@ if (typeof Slick === "undefined") {
function resizeCanvas() {
if (!initialized) { return; }
if (options.autoHeight) {
- viewportH = options.rowHeight * (getDataLength() + (options.enableAddRow ? 1 : 0) + (options.leaveSpaceForNewRows ? numVisibleRows - 1 : 0));
+ viewportH = options.rowHeight * (getDataLength() + (options.enableAddRow ? 1 : 0));
} else {
viewportH = getViewportHeight();
}

0 comments on commit 0b69e8a

Please sign in to comment.
Something went wrong with that request. Please try again.