:: Forum >> Version 2 >>

ajax cell refresh stops my keyboard navigation

I'm performing a cell edit and sending the data to my server via an ajax call. I'm returning a message telling me whether or not the value updated properly in the database and using the nifty indicator to alert the user.

In order for the indicator to display I'm using
obj.getCellTemplate(column,row).refresh();  in the ajax response function to refresh just the cell I updated.

My problem is that when I am traversing the grid using the keyboard arrows, they stop working when my ajax call returns. I then have to click on a cell with my mouse and can continue using the keyboard.

What it looks like is that the refresh() guy sets focus or something like that on the cell that made the ajax call so that my keyboard events don't apply. When I am editing a different cell when the ajax response comes back I have no problem.

Is there a way to either have the refresh not change the focus or detect where the focus should be and switch it back immediately? Or something else that I haven't thought of?
Chris
Thursday, May 18, 2006
Just so you know, I'm using "single-cell" selection. I tried saving the cell I was on in a variable, refreshing, and then setting the current cell and selected cell back to that after the refresh, but it didn't help. Can anyone help me?
Chris
Tuesday, May 23, 2006
I had the very same problem.
You can solve it by doing a CellTemplate.element.focus() two times on the cell.
You can find the right syntax on the forum.
Del
Tuesday, May 23, 2006
Here you are:
/javascript.forum.4990.1/set-focus-to-a-cell.html
Del
Tuesday, May 23, 2006
It worked - Thanks a ton!
Chris
Tuesday, May 23, 2006
By the way, the code is:

obj.getCellTemplate(selectedCol,selectedRow).element().focus(); 
Chris
Tuesday, May 23, 2006



This topic is archived.

Back to support forum

Forum search