<link rel="stylesheet" type="text/css" href="dbnetsuite.css.ashx" /> <script language="JavaScript" src="dbnetsuite.js.ashx"></script>
<script> jQuery(document).ready( init ) function init() { var ordersEdit = new DbNetEdit("ordersEdit"); with (ordersEdit) { connectionString = "SamplesDatabase" deleteRow = false search = false fromPart = "orders" } var ordersGrid = new DbNetGrid("ordersGrid"); with (ordersGrid) { connectionString = "SamplesDatabase" fromPart = "orders" setColumnExpressions("customerid","OrderDate") setColumnProperty("customerid","foreignKey", true) setColumnProperty("customerid","display", false) pageSize = 5 addLinkedControl(ordersEdit,true); } var customerGrid = new DbNetGrid("customerGrid"); with (customerGrid) { connectionString = "SamplesDatabase" fromPart = "customers" setColumnExpressions("CustomerID","CompanyName") addLinkedControl(ordersGrid,false); initialize() } } </script>
<table> <tr> <td style="vertical-align:top;"> <div> <div class="legend">Customers</div> <div id="customerGrid"></div> </div> </td> <td style="vertical-align:top;"> <div> <div class="legend">Orders</div> <div id="ordersGrid"></div> <div class="legend">Order</div> <div id="ordersEdit"> <div id="ordersEdit_toolbarPanel"></div> <table> <tr> <td> CustomerID </td> <td> <span ColumnExpression="CustomerID" ForeignKey="true"></span> </td> </tr> <tr> <td> OrderID </td> <td> <span ColumnExpression="OrderID"></span> </td> </tr> <tr> <td> OrderDate </td> <td> <span ColumnExpression="OrderDate"></span> </td> </tr> <tr> <td> Freight </td> <td> <span ColumnExpression="Freight" Format="c"></span> </td> </tr> </table> <div style="text-align:right;border-top:1pt solid silver; padding:5px;"> <button type="button" id="ordersEdit_insertRowBtn">Insert</button> <button type="button" id="ordersEdit_applyBtn">Apply</button> <button type="button" id="ordersEdit_cancelBtn">Cancel</button> </div> <div ID="ordersEdit_messagePanel"></div> <div> </div> </td> </tr> </table>