Permalink
Browse files

FIXED: old data getting referenced after a call to setData().

  • Loading branch information...
1 parent 34db300 commit c34a0a49b8349489c41f8c3e0f32b403dcf44f57 @mleibman mleibman committed Feb 25, 2011
Showing with 9 additions and 12 deletions.
  1. +9 −12 slick.grid.js
View
@@ -82,8 +82,7 @@ if (typeof Slick === "undefined") {
cellFlashingCssClass: "flashing",
selectedCellCssClass: "selected",
multiSelect: true
- },
- gridData;
+ };
var columnDefaults = {
name: "",
@@ -174,8 +173,6 @@ if (typeof Slick === "undefined") {
$container = $(container);
- gridData = data;
-
maxSupportedCssHeight = getMaxSupportedCssHeight();
scrollbarDimensions = scrollbarDimensions || measureScrollbar(); // skip measurement if already have dimensions
@@ -952,30 +949,30 @@ if (typeof Slick === "undefined") {
function setData(newData,scrollToTop) {
invalidateAllRows();
- gridData = newData;
+ data = newData;
if (scrollToTop)
scrollTo(0);
}
function getData() {
- return gridData;
+ return data;
}
function getDataLength() {
- if (gridData.getLength) {
- return gridData.getLength();
+ if (data.getLength) {
+ return data.getLength();
}
else {
- return gridData.length;
+ return data.length;
}
}
function getDataItem(i) {
- if (gridData.getItem) {
- return gridData.getItem(i);
+ if (data.getItem) {
+ return data.getItem(i);
}
else {
- return gridData[i];
+ return data[i];
}
}

0 comments on commit c34a0a4

Please sign in to comment.