Skip to content

Commit

Permalink
fixed #146 part 2/2. Fixed #66, #59 entirely finally.
Browse files Browse the repository at this point in the history
  • Loading branch information
TonyGermaneri committed Nov 4, 2018
1 parent c63a381 commit ff998b3
Show file tree
Hide file tree
Showing 8 changed files with 53 additions and 17 deletions.
2 changes: 1 addition & 1 deletion build.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2030
2031
30 changes: 24 additions & 6 deletions dist/canvas-datagrid.debug.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/canvas-datagrid.debug.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/canvas-datagrid.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/canvas-datagrid.map

Large diffs are not rendered by default.

11 changes: 10 additions & 1 deletion lib/events.js
Original file line number Diff line number Diff line change
Expand Up @@ -1159,12 +1159,21 @@ define([], function () {
l = clipData.length;
clipData.forEach(function (rowData) {
yi += 1;
var i = self.orders.columns[yi];
var i = self.orders.rows[yi];
self.data[i] = normalizeRowData(rowData, self.data[i], x, s, mimeType, i);
});
self.selections = sel;
return l;
};
self.getNextVisibleColumnIndex = function (visibleColumnIndex) {
var x, s = self.getVisibleSchema();
for (x = 0; x < s.length; x += 1) {
if (s[x].columnIndex === visibleColumnIndex) {
return s[x + 1].columnIndex;
}
}
return -1;
};
self.getVisibleColumnIndexOf = function (columnIndex) {
var x, s = self.getVisibleSchema();
for (x = 0; x < s.length; x += 1) {
Expand Down
19 changes: 14 additions & 5 deletions lib/publicMethods.js
Original file line number Diff line number Diff line change
Expand Up @@ -714,17 +714,26 @@ define([], function () {
sel.forEach(function (row, index) {
if (index === l) { return; }
if (row.length === 0) { return; }
row.forEach(function (col) {
if (!s[col]) { return; }
row.forEach(function (colIndex) {
// intentional redef of colIndex
colIndex = self.getVisibleColumnIndexOf(colIndex);
if (!s[colIndex]) { return; }
if (!self.data[index]) { self.data[index] = {}; }
self.data[index][s[col].name] = null;
self.data[index][s[colIndex].name] = null;
});
});
sel.forEach(function (row, index) {
var lastSourceIndex;
yi += 1;
xi = x - 1;
xi = self.getVisibleColumnIndexOf(x);
row.forEach(function (col, cidx) {
xi += 1;
col = self.getVisibleColumnIndexOf(col);
if (cidx > 0) {
// this confusing bit of nonsense figures out
// if the selection has skipped cells
xi += col - lastSourceIndex;
}
lastSourceIndex = col;
if (col === -1
|| !s[xi]
|| !s[col]
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "canvas-datagrid",
"version": "0.22.2",
"version": "0.22.3",
"description": "Canvas based data grid web component. Capable of displaying millions of contiguous hierarchical rows and columns without paging or loading, on a single canvas element.",
"main": "./dist/canvas-datagrid.js",
"scripts": {
Expand Down

0 comments on commit ff998b3

Please sign in to comment.