|
Rank: Newbie Groups: Member
Joined: 4/16/2013 Posts: 4
|
I am making an Excel-type grid with a fixed bottom footer row that sums values in the columns. The last column in the grid also provides a summary of some of the values in the row.
I have a javascript routine that updates the footer and row summaries that works fine. I want it to run immediately after one of the cells is edited. I have been trying to use ClientSideEndEdit, but it appears the value entering into the cell has not been committed to the grid, so the totals don't include the new value (until I finish editing another cell, but then that value is not include).
Alternatively, I tried firing my code using ClientSideOnItemOver which works if the user edits the value and then moves the mouse to another cell, but it doesn't work with keyboard navigation and would be updating the summaries constantly and unnecessarily.
Is there a different firing routine that I should be using or is there a way to commit the value to the cell in my at the beginning of my code that is called from ClientSideEndEdit.
Thank you.
|
|
Rank: Administration Groups: Administration
Joined: 5/27/2007 Posts: 24,195
|
Hi, ClientSideEndEdit is the right place to do it. What you will need to do is to use a setTimeout to delay the call to your update routine. So instead of calling:
; You do:
Code: JavaScript
setTimeout(function()
{
UpdateTotal();
}, 10);
This allows the calling code to return first to update the Grid cell value, then your UpdateTotal routine will be called. Thanks!
|
|
Rank: Newbie Groups: Member
Joined: 4/16/2013 Posts: 4
|
Worked perfectly. Thanks for the quick reply!
|
|
Rank: Administration Groups: Administration
Joined: 5/27/2007 Posts: 24,195
|
You are welcome. Please feel free to let us know if you have any more questions.
Thanks!
|
|