Start Building Professional
Web Apps Today


 
Categories Question details Back To List
Question  posted by G R on Jan 21, 2010 14:13
open dhtmlx forum
Capturing tab key using OnEditCell

Hi
I have a dhtmlxgrid within which i do basic date and numeric check validations, the requirement here is - I usually do the
follownig on Edit stage=2 ie. when user has finished editing , if focus moves out , we need to make a validation check
if user has entered a numeric value or not, when focus is moved out of the cell, the Oneditevent fires correctly throwing
the requisite validation message.

The problem is when user presses tab, the focus goes to the next cell, the focus should remain in the same cell when the validation check fails and an error message, inorder to achieve this am using Ontab event.

Is there a way to catch ascii value of a key pressed within the OnEditCell callback function?Would be happy if i get a quick response
Answer posted by Alex (support) on Jan 22, 2010 01:49

Hello,

there isn't built-in solution to keep editor opened.

There is live validation functionality that highlights incorrect value - possibly it'll be helpful:

http://www.dhtmlx.com/dhxdocs/doku.php?id=dhtmlxgrid:validation_extension#live_validation_mode

http://localhost/90226/dhtmlxGrid/samples/19_validation/01_live_validation.html

Regarding the tab issue - you can try to set onTab event and force editor opening by the selectCell method:

http://www.dhtmlx.com/dhxdocs/doku.php?id=dhtmlxgrid:api_method_dhtmlxgridobject_selectcell

http://www.dhtmlx.com/dhxdocs/doku.php?id=dhtmlxgrid:event_ontab