Intercept all keystrokes in grid cells
In my ActiveWidgets-based application, date fields in application screens (which use text input fields) have a special keyboard handling routine. I attach a function to the onfocus event of the field, which then attaches a function to the onkeydown event of the field. A function attached to the onblur event of the field puts everything back the way it was before the user entered the field. While editing the field, data entry is restricted to a defined date format (MM/DD/YYYY or MM/DD/YY) and slash characters are inserted automatically. When the user leaves the field, the date value is validated and an error is displayed if it is an incorrect date and two-digit years are automatically converted to four-digit years.
Some of the grids in this same application have columns that are used for dates, and I need to apply the same type of keyboard handling to those grid cells. But I've been having trouble finding the proper way of hooking into the appropriate events for the grid cell that would work the same way as the text input field. With the impending release of version 2.5 of ActiveWidgets, it sounds like the cell processing will be radically different, so I assume it would be better to implement it based on the 2.5 architecture. So how would I hook into the grid cell equivalent of the onfocus, onblur, and onkeydown events in version 2.5?
Some of the grids in this same application have columns that are used for dates, and I need to apply the same type of keyboard handling to those grid cells. But I've been having trouble finding the proper way of hooking into the appropriate events for the grid cell that would work the same way as the text input field. With the impending release of version 2.5 of ActiveWidgets, it sounds like the cell processing will be radically different, so I assume it would be better to implement it based on the 2.5 architecture. So how would I hook into the grid cell equivalent of the onfocus, onblur, and onkeydown events in version 2.5?
Randall Severy
November 27,