Welcome Guest Search | Active Topics | Sign In | Register

Excel-type grid and subtotals Options
Beedge
Posted: Thursday, April 18, 2013 3:29:34 PM
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.
eo_support
Posted: Thursday, April 18, 2013 5:16:33 PM
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:

Code: JavaScript
UpdateTotal()
;

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!

Beedge
Posted: Thursday, April 18, 2013 7:02:54 PM
Rank: Newbie
Groups: Member

Joined: 4/16/2013
Posts: 4
Worked perfectly. Thanks for the quick reply!
eo_support
Posted: Thursday, April 18, 2013 8:26:10 PM
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!


You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.