This is very od, ill explain it the best I can.
I'm watching for keypress events. See below of strange results.
1) if I press a key on the stage event Triggers
1) if I press a key on a grid event Triggers
1) if I'm in edit mode on a grid only the 5th key press ( letter or number ) fires the browser keypress event.
a) double click to edit a cell
b) press the letter a ( not event fires )
c) press the letter b ( not event fires )
d) press the letter c ( not event fires )
e) press the letter d ( not event fires )
f) press the letter e ( event fires )
Any ideas? I need my even to fire after any keypress.
Hello Sean,
If you want to handle the keypress while in edit mode the best way to do it is to hook to the igEditor.keypress event. While in edit mode the grid displays igEditors for each cell. Here is an example code on how to hook to the keypress event of igEditor for column "Name":
Best regards,Martin PavlovInfragistics, Inc.
"I mean not your product's code, but a simple html page" Oh I do understand what you mean but this is not just a simple page. The html is all dynamic so there is no way to show it in simple terms, that I know of. The code the generates the html is 1000 lines long.
Which events?
and
How do you handle this key press event?
like so.
//BROWSER CHECK if ( document.addEventListener ) { document.addEventListener( "keypress", keypress, false ); }//try to catch key presses from all browsers. else if ( document.attachEvent ) { document.attachEvent( "onkeypress", keypress ); } else { document.onkeypress = keypress } function keypress( e ) {alert( e.keyCode )<---- this="" alert="" would="" popup="" if="" any="" of="" these="" events="" were="" triggered="" so="" strong=""> if ( _currentWindowActive != null && (e.keyCode == 27 || e.keyCode == 13 || e.which == 27 || e.which == 13 || _currentWindowActive.isEditing() )) return true;//http://www.cambiaresearch.com/articles/15/javascript-char-codes-key-codes _currentWindowActive.setEditMode( true, e.keyCode || e.which ); return false; }
if you want to handle the keypress while in edit mode the best way to do it is to hook to the igEditor.keypress event. While in edit mode the grid displays igEditors for each cell. Here is an example code on how to hook to the keypress event of igEditor for column "Name":
This does work in the sense that it fires an event for each key press but I'll never know what column I'm in and if the columnKey is a needed field I have no way to predict that.
My only guess is that something is blocking my browser keypress events when in a cell for editing. As far as I know there are no debugging tools to debug events.
If you have no further suggestions I thank you for your time.
--------------------------------------------------------------------------------------------
Oh BTW: In chrome and IE I never get browsers events. In FF its the 5th key press. I found a way to handle his and made it consistent fixing my issue. I would still be interested in hering any advice you may have but this fix I made for FF will do.