Mercurial > urweb
diff demo/more/grid1.ur @ 937:37dd42935dad
Summary row with aggregates
author | Adam Chlipala <adamc@hcoop.net> |
---|---|
date | Tue, 15 Sep 2009 10:18:56 -0400 |
parents | 2422360c78a3 |
children | e2be476673f2 |
line wrap: on
line diff
--- a/demo/more/grid1.ur Tue Sep 15 09:45:46 2009 -0400 +++ b/demo/more/grid1.ur Tue Sep 15 10:18:56 2009 -0400 @@ -45,7 +45,18 @@ DA = computed "2A" (fn r => 2 * r.A), Link = computedHtml "Link" (fn r => <xml><a link={page (r.A, r.B)}>Go</a></xml>)} - val aggregates = {} + val aggregates = {Dummy1 = {Initial = (), + Step = fn _ _ => (), + Display = fn _ => <xml/>}, + Sum = {Initial = 0, + Step = fn r n => r.A + n, + Display = txt}, + Dummy2 = {Initial = (), + Step = fn _ _ => (), + Display = fn _ => <xml>-</xml>}, + And = {Initial = True, + Step = fn r b => r.C && b, + Display = txt}} end) fun main () =