aboutsummaryrefslogtreecommitdiffhomepage
path: root/demo/more/grid.urs
blob: 191ec49a17e4d954c1c5f5524e63ac463c4c6357 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
con colMeta' = fn (row :: Type) (t :: Type) =>
                  {Header : string,
                   Project : row -> transaction t,
                   Update : row -> t -> transaction row,
                   Display : t -> xbody,
                   Edit : t -> xbody,
                   Validate : t -> signal bool}
                  
con colMeta = fn (row :: Type) (global_t :: (Type * Type)) =>
                 {Initialize : transaction global_t.1,
                  Handlers : global_t.1 -> colMeta' row global_t.2}

functor Make(M : sig
                 type row
                 val list : transaction (list row)
                 val new : transaction row
                 val save : {Old : row, New : row} -> transaction unit
                 val delete : row -> transaction unit

                 con cols :: {(Type * Type)}
                 val cols : $(map (colMeta row) cols)

                 val folder : folder cols
             end) : sig
    type grid

    val grid : transaction grid
    val sync : grid -> transaction unit
    val render : grid -> xbody
                           
    style tabl
    style tr
    style th
    style td
end