Login Register

database table maintenance (insert, update, delete and browse capabilities)

This demo shows the use of the following widgets... SuperGridStoreControls - store controls used for add, delete, commit and rollback. Coordinates the gridForm and grid widgets. SuperGridForm - used to display an individual item that is either selected from the grid widget or is a new item being added to the database. SuperGrid - used to display the table. Provides filtering, sorting and paging capabilities. SuperGridNavigator - Coordinates navigation through the SuperGrid Any database errors are passed through to the end user in a dialog box ( eg. Try to set the Strategy field to a string containing more than 1 character). Feel free to insert, delete and update rows but please don't delete ALL the rows from the table. http://weblogic.cyberavenue.com.au/SuperGridWebApp/msss_master_config1.h... Below is the page source...
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
        <title>MSSS MASTER CONFIG</title>
        <meta http-equiv="Content-Type" content="text/html; charset=utf-8"></meta>
<script type="text/javascript">var djConfig = { isDebug: false };</script>
        <script type="text/javascript" src="./resources/dojo_latest/dojo.js"></script>
        <script type="text/javascript">
        dojo.hostenv.supergridServletPath = "SuperGridServlet";
        dojo.registerModulePath("supergrid", "../supergrid");
        dojo.require("supergrid.widget.SuperGridTable");
        dojo.require("supergrid.widget.SuperGridComboBox");
        dojo.require("supergrid.widget.SuperGridForm");
        dojo.require("supergrid.widget.SuperGridNavigator");
        dojo.require("supergrid.widget.SuperGridStoreControls");
        </script>
<link rel="stylesheet" type="text/css" href="./resources/css/SuperGridStyles1.css" />
    <link rel="stylesheet" type="text/css" href="./resources/css/sparq.css" />
   
</head>
<body>
    <b>MSSS MASTER CONFIG</b><br>
    <table dojoType="supergrid:SuperGridStoreControls" superGridId="msss_master_config" superGridFormId="msss_master_config_form"></table>
   
    <form dojoType="supergrid:superGridForm" widgetsInTemplate="true" id="msss_master_config_form" superGridId="msss_master_config" class="form">
    <table class="form" border="0">
        <tr>
            <td valign="top">
                <table border="0">
                    <tr><td width="100px">Equip. Class:</td><td><input dojoType="supergrid:SuperGridComboBox" id="EQUIP_CLASS" tableType="EC" superGridId="msf010"></td></tr>
                    <tr><td width="100px">Equip. Grp Id:</td><td><input dojoType="supergrid:SuperGridComboBox" id="EQUIP_GRP_ID" tableType="GI" superGridId="msf010"></td></tr>
                    <tr><td width="100px">Comp. Code:</td><td><input dojoType="supergrid:SuperGridComboBox" id="COMP_CODE" tableType="CO" superGridId="msf010"></td></tr>
                    <tr><td width="100px">Modifier Code:</td><td><input dojoType="supergrid:SuperGridComboBox" id="COMP_MOD_CODE" tableType="MO" superGridId="msf010"></td></tr>
                    <tr><td width="100px">Failure Mode:</td><td><input dojoType="supergrid:SuperGridComboBox" id="FAILURE_MODE" tableType="W0" superGridId="msf010"/></td></tr>
                    <tr><td width="100px">Failure Code:</td><td><input dojoType="supergrid:SuperGridComboBox" id="FAILURE_CODE" tableType="W1" superGridId="msf010"/></td></tr>
                    <tr><td width="100px">Function Code:</td><td><input dojoType="supergrid:SuperGridComboBox" id="FUNCTION_CODE" tableType="W2" superGridId="msf010"/></td></tr>
                    <tr><td width="100px">Consequence:</td><td><input dojoType="supergrid:SuperGridComboBox" id="CONSEQUENCE" tableType="W3" superGridId="msf010"/></td></tr>
                </table>
            </td>
            <td valign="top">
                <table border="0">
                    <tr><td>Strategy:</td><td colspan="2"><input id="STRATEGY" type="text"/></td></tr>
                    <tr><td>Effect:</td><td colspan="2"><input id="EFFECT" type=text></td></tr>
                    <tr><td>Agreed Action:</td><td colspan="2"><input id="AGREED_ACTION" type="text"/></td></tr>
                </table>
            </td>
        </tr>
    </table>
    </form>
   
    <div class="display">
    <table dojoType="supergrid:superGridTable" class="list" id="msss_master_config"
                   multiple="false" alternateRows="true" cellpadding="0" cellspacing="0" border="0"
           minRows="20" maxSortable="2" showNavigationBar="false" loadOnInit="true">

    </table>
    </div>
   
    <table dojoType="supergrid:SuperGridNavigator" superGridId="msss_master_config"></table>
   
    <table dojoType="supergrid:SuperGridPopupTable" class="popup" id="msf010"
                   multiple="false" alternateRows="false" border="1" cellpadding="0" cellspacing="0" border="0"
           minRows="10" maxSortable="2" showNavigationBar="true"
           loadOnInit="false"
           showStatusDialog="false"
           showHeader="true"
           >

    </table>
</body>
</html>

Demo updated

This demo has the following changes

* Release build of dojo that includes the supergrid widgets. This should increase the initial loading time of the page.
* The form and grid are now contained in a FloatingPane.
* Navigation control now includes a refresh and cancel button.
* Other widget and backend changes to optimise performance.

Original post updated to use

Original post updated to use the code highlighter.

-Karl

What about the server-side component?

I'm assuming dojo.hostenv.supergridServletPath is a reference to some server side component like a php page or asp?

Can you provide the code for that?

Thanks,
Peter