diff options
author | mleibman <michael.leibman@gmail.com> | 2011-02-24 17:29:38 -0800 |
---|---|---|
committer | mleibman <michael.leibman@gmail.com> | 2011-02-24 17:29:38 -0800 |
commit | c34a0a49b8349489c41f8c3e0f32b403dcf44f57 (patch) | |
tree | 9c0205d32eb4dc30f440683d2dcc4792e68f8dfc | |
parent | 34db300b61560ac31d4e3a2426dea291c3d01057 (diff) | |
download | SlickGrid-c34a0a49b8349489c41f8c3e0f32b403dcf44f57.zip SlickGrid-c34a0a49b8349489c41f8c3e0f32b403dcf44f57.tar.gz SlickGrid-c34a0a49b8349489c41f8c3e0f32b403dcf44f57.tar.bz2 |
FIXED: old data getting referenced after a call to setData().
-rw-r--r-- | slick.grid.js | 21 |
1 files changed, 9 insertions, 12 deletions
diff --git a/slick.grid.js b/slick.grid.js index 8891bf1..7f42d03 100644 --- a/slick.grid.js +++ b/slick.grid.js @@ -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]; } } |