karen
Posts: 99
|
| Posted: 01/08/2009, 9:37 PM |
|
Hi all,
I am trying to sum a column in an editable grid and display this total on the form. I have had a look at the javascript solution (http://forums.codecharge.com/posts.php?post_id=90723&s_keyword=editable+grid+total) but can't get it to work. I use PHP/MySQL. I really appreciate any tips at all. Thanks in advance.
|
 |
 |
karen
Posts: 99
|
| Posted: 01/11/2009, 1:07 AM |
|
Hi all,
No worries, I got it to work. The code is all good if anyone else needs to do the same. Cheers!
|
 |
 |
asawyer13
Posts: 46
|
| Posted: 01/11/2009, 6:15 AM |
|
Could you post it so eventually when I need it, it will be available?
Thanks,
Alan
|
 |
 |
damian
Posts: 838
|
| Posted: 01/11/2009, 6:19 AM |
|
http://forums.codecharge.com/posts.php?post_id=90723&s_...able+grid+total
_________________
if you found this post useful take the time to help someone else.... :)
|
 |
 |
karen
Posts: 99
|
| Posted: 02/25/2009, 8:03 PM |
|
I have a small problem. I have modified the code not to sum the rows that are checked for delete. However, this also excludes new rows. For some reason, the delete_control.checked is returning not true for the new rows even though the control is non-existant. How can I modify the code to exclude rows that are checked to be deleted but include new rows?
Here's the if statement:
if (fin_tithes_paymentsElements[j][fin_tithes_paymentstithes_payment_amtID].value && !fin_tithes_paymentsElements[j][fin_tithes_paymentsDeleteControl].checked)
I hope someone has done this before or has some ideas for me to try. Thanks in advance!
Cheers,
Karen
|
 |
 |
karen
Posts: 99
|
| Posted: 02/26/2009, 12:55 AM |
|
Ok, in case anyone else tries to do the same, you need to check if the delete control is undefined (for new rows), like so,
if(typeof fin_tithes_paymentsElements[j][fin_tithes_paymentsDeleteControl] == 'undefined')
That solved it! Sorry for making anyone crack their heads like I did mine :P
|
 |
 |
|