3.0.5

Select a specific cell

Does anyone know a solution for the following:

I want to use the tab key to move between the fields of my grid.
This is not default behaviour, but is should imitate the behaviour of the normal left and right keys.

when I use the onKeyTab event, my code is executed, however functions like selectCell(c,r) or setCurrentColumn(c) are not functional.

selectCell is an internal function but could be usefull as method as well, but setCurrentColumn isn't and should therefore work.

Is this issue fixed in the final release? I am still using b├Ęta 4.
Or am I doing something completely wrong?
A working tab-key in this grid will be my final decision to buy this script for my application.

Just for reference, my code:

obj.onKeyTab = function(event){
var col=obj.getCurrentColumn();
var row=obj.getCurrentRow();
col=col*1 // *1 to convert col to integer
col=col+1 // move to next column
alert(col + ' ' + row) // for debug to see if code is running
obj.setCurrentColumn(col);
}

Thx in advance...
Wim Zoet
February 18,
It seemed a timeout is able to do the trick.

for interested people, the code that works for me:

obj.onKeyTab = function(event){
var col=obj.getCurrentColumn();
col=(col*1)+1;
setTimeout("myGrid.focus();obj.setSelectedColumns(["+col+"]);obj.setCurrentColumn("+col+");",100);
}

the timeout of 100ms works on my system, with my additions to the validation-code for each cell, however, this could probably change on different systems or different program-setups.

Wim Zoet
February 21,

This topic is archived.

See also:


Back to support forum