adamc@1039: open Dbgrid
adamc@1039: 
adamc@1039: sequence s
adamc@1039: table t : {Id : int, A : int}
adamc@1039:   PRIMARY KEY Id
adamc@1039: 
adamc@1039: open Make(struct
adamc@1039:               val tab = t
adamc@1039:               con key = [Id = _]
adamc@1039: 
adamc@1039:               val raw = {Id = {New = nextval s,
adamc@1039:                                Inj = _},
adamc@1039:                          A = {New = return 0,
adamc@1039:                               Inj = _}}
adamc@1039: 
adam@1304:               val cols = {Id = Direct.readOnly [#Id] "Id" Direct.int,
adam@1304:                           A = Direct.editable [#A] "A" Direct.int}
adamc@1039: 
adamc@1039:               val aggregates = {}
adamc@1039: 
adamc@1039:               val pageLength = None
adamc@1039:           end)
adamc@1039: 
adamc@1039: fun main () =
adamc@1039:     grid <- grid;
adamc@1039:     set (showSelection grid) True;
adamc@1039:     return <xml>
adamc@1039:       <head>
adamc@1039:         <link rel="stylesheet" type="text/css" href="../../grid.css"/>
adamc@1039:       </head>
adamc@1039:       <body onload={sync grid}>
adamc@1039:         {render grid}
adamc@1039:       </body>
adamc@1039:     </xml>