This is a migrated thread and some comments may be shown as answers.

Bug in the focusout event handler when editing a grid cell

0 Answers 78 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Bob
Top achievements
Rank 1
Bob asked on 07 Nov 2012, 05:11 PM
Inside of the Grid code, there is a handler function attached to the current cell's focusout event.  This function grabs the current element that was clicked, and checks if it is a child of the current cell.  If it is, then it keeps the cell in edit mode, and if it isn't, it knows the user clicked else where and so it closes the current cell's edit mode.

The bug that I'm seeing in IE is that you're grabbing the target element that was clicked by using document.activeElement.  In IE, in some scenarios (not sure exactly which scenarios, nor do I have the time to figure it out or try to reproduce, sorry.), document.activeElement is set to the body element.  The code then checks to see if the current cell contains the body, which of course it doesn't, so it closes the cell's edit mode.

I worked around this by passing the jquery event object to the handler, and then setting target equal to the event.target property.  event.target *should* always be the same as document.activeElement, but of course in IE *should* and *is* are quite often miles apart.

Just wanted to bring this to your attention.  Hopefully this is the right place to bring this up.

Thanks,
Bob

No answers yet. Maybe you can help?

Tags
Grid
Asked by
Bob
Top achievements
Rank 1
Share this question
or