机がある
SUM | <input type="text"> | <input type="text"> |
| <input type="text"> | <input type="text"> |
| <input type="text"> | <input type="text"> |
SUM | <input type="text"> | <input type="text"> |
| <input type="text"> | <input type="text"> |
FOO | <input type="text"> | <input type="text"> |
BAR | <input type="text"> | <input type="text"> |
入力値が変更されたときに「SUM行」の下の列の合計を取得したい。FOO BAR 以外の列がある場合は、合計する必要はありません。
ここでアプローチとは何ですか?ダミーのアイデア: すべての列には、値が合計される場所への参照があります。
クイック スタートのフィドル: http://jsfiddle.net/igos/vNxzu/
EDIT 次の合計行まで合計する必要があります。
row 0 col 0 = row 1 col 0 + row 2 col 0
row 0 col 1 = row 1 col 1 + row 2 col 1
row 3 col 0 = row 4 col 0
row 3 col 1 = row 4 col 1
動的でなければならないので、行が増えると自動的に行が追加されます。