:: Forum >>

Event handler problem in IE

Hello EveryBody,
I am displaying grid and by default i am selecting first row using setSelectedRows([0]) method.Now i am attaching event handlers to the grid using setEvent method.I want to execute some functionality when i press enter in any row of the grid. It is working fine only,we I click on any row and press enter.After loading the grid, if i won't click on the row and if i press enter it is not working.My question is cann't it take the row selected using setSelectedRows([0]) as default row and execute the functionality by pressing enter key.

ie: event handlers are not working without clicking on any row.

I am using the following code for event handlers.
var myKeyEventHandler = function(){
obj.setEvent("onkeydown", myKeyEventHandler);
Thursday, July 19, 2007
Hi VaraPrasad,

Please try below code. I have set focus to cellinstead of row.

<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Untitled Document</title>


<table width="100%" border="1" cellspacing="0" cellpadding="0" id="tblID">
<tr id="testTd">
<script language="javascript">
var myKeyEventHandler = function(){alert('Hello World');}
document.getElementById('testTd').onkeydown = myKeyEventHandler;

Ravi Katre
Ravi Katre
Friday, July 20, 2007
The keyboard events fire only when the control has focus (is activated). Use focus() method after the page is loaded -

Alex (ActiveWidgets)
Friday, July 20, 2007
Thanks Alex.
When I use grid.focus() it is working fine
Monday, July 23, 2007

This topic is archived.

Back to support forum

Forum search