modules/org.openbravo.client.application/web/org.openbravo.client.application/example/grid-example.html
author Harpreet Singh <harpreet@openbravo.com>
Fri, 10 Dec 2010 19:47:45 +0100
changeset 9076 c4f1a5c7d7c2
permissions -rw-r--r--
Added 3.0 modules to modules dir and changed the VERSION number
harpreet@9076
     1
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
harpreet@9076
     2
<html>
harpreet@9076
     3
    <head>
harpreet@9076
     4
        <meta http-equiv="Expires" content="Tue, 24 Apr 1979 00:00:01 GMT"/>
harpreet@9076
     5
        <meta http-equiv="Content-type" content="text/html;charset=utf-8"/>
harpreet@9076
     6
        <link rel="shortcut icon" href="../images/favicon.ico" />
harpreet@9076
     7
        <script type="text/javascript">
harpreet@9076
     8
            var OB_smartClientSkinLocation = 'web/org.openbravo.userinterface.smartclient/openbravo/skins/3.00/smartclient/';
harpreet@9076
     9
        </script>
harpreet@9076
    10
        <script type="text/javascript" src="../../../org.openbravo.client.kernel/OBCLKER_Kernel/StaticResources">
harpreet@9076
    11
        </script>
harpreet@9076
    12
        <script type="text/javascript" src="grid-example.js">
harpreet@9076
    13
        </script>
harpreet@9076
    14
        <title>Openbravo Test Grid</title>
harpreet@9076
    15
    </head>
harpreet@9076
    16
    <body>
harpreet@9076
    17
        <script type="text/javascript">
harpreet@9076
    18
            var selectionLayout = isc.OBTestSelectionLayout.create({
harpreet@9076
    19
            
harpreet@9076
    20
              // set the action handler providing the data 
harpreet@9076
    21
              // and executing the actions
harpreet@9076
    22
              actionHandler: 'org.openbravo.client.application.example.GridExampleActionHandler',
harpreet@9076
    23
              
harpreet@9076
    24
              buttonProperties: {
harpreet@9076
    25
                // TODO: use OB.I18N.getLabel 
harpreet@9076
    26
                title: 'Click me!'
harpreet@9076
    27
              },
harpreet@9076
    28
              gridProperties: {
harpreet@9076
    29
              
harpreet@9076
    30
                // The fields to display
harpreet@9076
    31
                // in production the field title needs to use translated labels
harpreet@9076
    32
                // see the client kernel developers manual 
harpreet@9076
    33
                fields: [{
harpreet@9076
    34
                  name: 'name',
harpreet@9076
    35
                  width: 100,
harpreet@9076
    36
                  title: 'Name',
harpreet@9076
    37
                  type: 'text'
harpreet@9076
    38
                }, {
harpreet@9076
    39
                  name: 'windowCount',
harpreet@9076
    40
                  title: "Number of Windows",
harpreet@9076
    41
                  width: 100,
harpreet@9076
    42
                  type: 'integer',
harpreet@9076
    43
                  canFilter: false
harpreet@9076
    44
                }]
harpreet@9076
    45
              }
harpreet@9076
    46
            });
harpreet@9076
    47
            
harpreet@9076
    48
            // and show the grid, note that autoDraw is false as a default
harpreet@9076
    49
            // so you need to explicitly call draw
harpreet@9076
    50
            selectionLayout.draw();
harpreet@9076
    51
        </script>
harpreet@9076
    52
    </body>
harpreet@9076
    53
</html>