Check documentation for the latest version of dhtmlxSuite selectCell DHTMLX Docs

selectCell

sets selection to the specified row-cell

void selectCell(number|HTMLElement row,number cInd,boolean preserve,boolean edit,boolean show);
rownumber|HTMLElementrow index or row object
cIndnumbercell index
preservebooleanpreserve previously selected rows, true/false (optional, false by default). Multiselect mode should be enabled
editbooleanswitch selected cell to the edit mode (optional, false by default)
showbooleantrue|false - scroll row to view (optional, true by default)

Example

//select the second cell of the first row 
myTreeGrid.selectCell(0,1);
//select the second cell of the first row, call "onRowSelect" event, 
//preserve previously selected rows
myTreeGrid.selectCell(0,1,true,true);
 
 
//select the second cell of the 11th row, switch cell to the edit mode
<button onclick="myfunc()">select cell</button>
 
<script>
    function myfunc(){
        (arguments[0]||window.event).cancelBubble=true;
        myTreeGrid.selectCell(10,1,false,false,true);
    }
</script>

Back to top