summaryrefslogtreecommitdiff
path: root/demo/more/grid0.ur
blob: 3e3d27abc5072157d307c37b1a56614e30bf998f (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
open Dbgrid

sequence s
table t : {Id : int, A : int}
  PRIMARY KEY Id

open Make(struct
              val tab = t
              con key = [Id = _]

              val raw = {Id = {New = nextval s,
                               Inj = _},
                         A = {New = return 0,
                              Inj = _}}

              val cols = {Id = Direct.readOnly [#Id] ! "Id" Direct.int,
                          A = Direct.editable [#A] ! "A" Direct.int}

              val aggregates = {}

              val pageLength = None
          end)

fun main () =
    grid <- grid;
    set (showSelection grid) True;
    return <xml>
      <head>
        <link rel="stylesheet" type="text/css" href="../../grid.css"/>
      </head>
      <body onload={sync grid}>
        {render grid}
      </body>
    </xml>