Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

make CellSelection work with tree mode #831

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 6 additions & 5 deletions CellSelection.js
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,8 @@ return declare(Selection, {
// find if it is earlier or later in the DOM
var traverser = (toElement && (toElement.compareDocumentPosition ?
toElement.compareDocumentPosition(fromElement) == 2 :
toElement.sourceIndex > fromElement.sourceIndex)) ? "nextSibling" : "previousSibling";
toElement.sourceIndex > fromElement.sourceIndex)) ? "down" : "up";

// now we determine which columns are in the range
var idFrom = cell.column.id, idTo = toCell.column.id, started, columnIds = [];
for(id in this.columns){
Expand All @@ -120,19 +121,19 @@ return declare(Selection, {
}
}
// now we iterate over rows
var row = cell.row, nextNode = row.element;
var row = cell.row;
toElement = toCell.row.element;
do{
// looping through each row..
// and now loop through each column to be selected
for(i = 0; i < columnIds.length; i++){
cell = this.cell(nextNode, columnIds[i]);
cell = this.cell(row, columnIds[i]);
this._select(cell, null, value);
}
if(nextNode == toElement){
if(row.element == toElement){
break;
}
}while((nextNode = cell.row.element[traverser]));
}while(row = this[traverser](row));
}
}
},
Expand Down