Skip to content

Commit

Permalink
Added support for bottom padding in grid-canvas
Browse files Browse the repository at this point in the history
  • Loading branch information
mg5130 committed Nov 13, 2012
1 parent db41338 commit a43163a
Showing 1 changed file with 14 additions and 4 deletions.
18 changes: 14 additions & 4 deletions slick.grid.js
Expand Up @@ -173,6 +173,8 @@ if (typeof Slick === "undefined") {
var renderLock;
var rowsToRemove = {};

// bottom space
var bottomPadd = 0;

//////////////////////////////////////////////////////////////////////////////////////////////
// Initialization
Expand Down Expand Up @@ -1195,8 +1197,9 @@ if (typeof Slick === "undefined") {
// Rendering / Scrolling

function scrollTo(y) {

y = Math.max(y, 0);
y = Math.min(y, th - viewportH + (viewportHasHScroll ? scrollbarDimensions.height : 0));
y = Math.min(y, th - viewportH + (viewportHasHScroll ? scrollbarDimensions.height : 0) + bottomPadd);

var oldOffset = offset;

Expand Down Expand Up @@ -1613,7 +1616,8 @@ if (typeof Slick === "undefined") {
return parseFloat($.css($container[0], "height", true)) -
parseFloat($.css($headerScroller[0], "height")) - getVBoxDelta($headerScroller) -
(options.showTopPanel ? options.topPanelHeight + getVBoxDelta($topPanelScroller) : 0) -
(options.showHeaderRow ? options.headerRowHeight + getVBoxDelta($headerRowScroller) : 0);
(options.showHeaderRow ? options.headerRowHeight + getVBoxDelta($headerRowScroller) : 0) -
bottomPadd;
}

function resizeCanvas() {
Expand Down Expand Up @@ -3091,7 +3095,11 @@ if (typeof Slick === "undefined") {
selectionModel.setSelectedRanges(rowsToRanges(rows));
}


function bottomPadding(height) {
bottomPadd = height;
resizeCanvas();
}

//////////////////////////////////////////////////////////////////////////////////////////////
// Debug

Expand Down Expand Up @@ -3239,7 +3247,9 @@ if (typeof Slick === "undefined") {

// IEditor implementation
"getEditorLock": getEditorLock,
"getEditController": getEditController
"getEditController": getEditController,

"bottomPadding": bottomPadding
});

init();
Expand Down

0 comments on commit a43163a

Please sign in to comment.