Start Building Professional
Web Apps Today


 
Categories Question details Back To List
Question  posted by Alim Hassam on Oct 30, 2008 14:56
open dhtmlx forum
Single clik block selection

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
Answer posted by Support on Oct 31, 2008 03:05
Your current solution works correctly, but immediately after that event, onclick event reaches grid, and grid hides block selection.

Please check 
http://dhtmlx.com/docs/products/kb/index.shtml?cat=search&page=1&q=4125&ssr=yes&s=selection%20single%20cell