Skip to content

Instantly share code, notes, and snippets.

@dmachi
Created May 20, 2013 15:49
Show Gist options
  • Save dmachi/5613121 to your computer and use it in GitHub Desktop.
Save dmachi/5613121 to your computer and use it in GitHub Desktop.
select visible nodes in a dgrid
var dh = domGeom.getMarginBox(grid.contentNode).h;
var scrollPos = grid.getScrollPosition();
var rows = Query(".dgrid-row",grid.contentNode).filter(function(node){
return ((node.offsetTop>=scrollPos.y) && ((node.offsetTop + (.75 * node.offsetHeight)) <(scrollPos.y+dh)));
});
grid.clearSelection();
grid.select(rows[0], rows[rows.length-1]);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment