summaryrefslogtreecommitdiff
path: root/demo/more/grid.ur
diff options
context:
space:
mode:
Diffstat (limited to 'demo/more/grid.ur')
-rw-r--r--demo/more/grid.ur32
1 files changed, 19 insertions, 13 deletions
diff --git a/demo/more/grid.ur b/demo/more/grid.ur
index 424c3b6f..6dd0543a 100644
--- a/demo/more/grid.ur
+++ b/demo/more/grid.ur
@@ -80,19 +80,13 @@ functor Make(M : sig
(meta.Handlers state).CreateFilter)
[_] M.folder M.cols cols;
- rows <- Dlist.create {Filter = fn all =>
- row <- signal all.Row;
- foldR3 [colMeta M.row] [fst3] [thd3] [fn _ => M.row -> signal bool]
- (fn [nm :: Name] [p :: (Type * Type * Type)]
- [rest :: {(Type * Type * Type)}] [[nm] ~ rest]
- meta state filter combinedFilter row =>
- previous <- combinedFilter row;
- this <- (meta.Handlers state).Filter filter row;
- return (previous && this))
- (fn _ => return True)
- [_] M.folder M.cols cols filters row};
+ rows <- Dlist.create;
sel <- source False;
- return {Cols = cols, Rows = rows, Selection = sel, Filters = filters}
+
+ return {Cols = cols,
+ Rows = rows,
+ Selection = sel,
+ Filters = filters}
fun sync {Cols = cols, Rows = rows, ...} =
Dlist.clear rows;
@@ -207,7 +201,19 @@ functor Make(M : sig
</td></xml>)
[_] M.folder grid.Cols M.cols cols)}/>
</tr></xml>
- end) grid.Rows}
+ end)
+ {Filter = fn all =>
+ row <- signal all.Row;
+ foldR3 [colMeta M.row] [fst3] [thd3] [fn _ => M.row -> signal bool]
+ (fn [nm :: Name] [p :: (Type * Type * Type)]
+ [rest :: {(Type * Type * Type)}] [[nm] ~ rest]
+ meta state filter combinedFilter row =>
+ previous <- combinedFilter row;
+ this <- (meta.Handlers state).Filter filter row;
+ return (previous && this))
+ (fn _ => return True)
+ [_] M.folder M.cols grid.Cols grid.Filters row}
+ grid.Rows}
<dyn signal={rows <- Dlist.foldl (fn row => Monad.mapR2 [aggregateMeta M.row] [id] [id]
(fn [nm :: Name] [t :: Type] meta acc =>