Hi,
I would like to know if its possible to create a block selection of a single left click instead of having to perform a drag.
I tried something like this, but i’m not sure how to get the selected row and column. Any other solution would be good also.
This doesn’t select the right cell
thegrid.attachEvent(“onBeforeSelect”,function(oldrow, newrow){
var row = newrow;
var col = 3;
thegrid._HideSelection();
thegrid._CreateSelection(0,0);
thegrid._ShowSelection();
thegrid._selectionArea = thegrid._RedrawSelectionPos(
thegrid.cellByIndex(parseInt(row), parseInt(col)).cell,
thegrid.cellByIndex(parseInt(row), parseInt(col) ).cell);
return false;
});
Thank you,
-Alim
Your current solution works correctly, but immediately after that event, onclick event reaches grid, and grid hides block selection.
Please check
dhtmlx.com/docs/products/kb/inde … gle%20cell