Include the client JavaScript & CSS libraries
<link rel="stylesheet" type="text/css" href="dbnetsuite.css.ashx" />
<script language="JavaScript" src="dbnetsuite.js.ashx"></script>
Client-side configuration script
<script>
jQuery(document).ready( init )
function init()
{
var dbnetgrid1 = new DbNetGrid("dbnetgrid1");
with (dbnetgrid1)
{
connectionString = "SamplesDatabase"
fromPart = "orders"
setColumnExpressions("OrderID","OrderDate","RequiredDate","ShippedDate","Freight","CustomerID")
setColumnProperty("OrderDate","Format","D")
setColumnProperty("RequiredDate","Format","d")
setColumnProperty("ShippedDate","Format","MMM yyyy")
setColumnProperty("Freight","Format","c")
setColumnProperty("OrderDate","Format","D")
setColumnProperty("CustomerID", {foreignKey : true, display : false, editDisplay : false});
}
var dbnetedit1 = new DbNetEdit("dbnetedit1");
with (dbnetedit1)
{
connectionString = "SamplesDatabase"
fromPart = "customers"
setColumnExpressions("CustomerID","CompanyName","ContactName","ContactTitle","Address","City","Region","PostalCode","Country","Phone","Fax")
setColumnLabels("Customer ID","Company Name","Contact Name","Title","Address","City","Region","Zip","Country","Phone","Fax")
setColumnProperty("Address","editControlType","TextArea");
setColumnProperty("Address","style","height:30px;width:300px");
addLinkedControl(dbnetgrid1,false);
initialize()
}
}
</script>
HTML markup
<div style="float:left;border-right:1pt solid #CCC;padding:10px;">
<h3>Customers</h3>
<hr/>
<div id="dbnetedit1"></div>
</div>
<div style="float:left;padding:10px;">
<h3>Orders</h3>
<hr/>
<div id="dbnetgrid1"></div>
</div>