<script>
jQuery(document).ready( init )
function init()
{
var countries = new DbNetCombo("countries");
var cities = new DbNetCombo("cities");
var customers = new DbNetCombo("customers");
var orders = new DbNetGrid("orders");
var orderDetails = new DbNetGrid("orderDetails");
with (orderDetails)
{
connectionString = "SamplesDatabase"
fromPart = "[order details]"
setColumnExpressions("OrderID","ProductID","Quantity","UnitPrice");
navigation = false
setColumnProperty("OrderID", "foreignKey", true);
setColumnProperty("OrderID", "display", false);
setColumnProperty("ProductID", "lookup", "select productid, productname from products");
}
with (orders)
{
connectionString = "SamplesDatabase"
fromPart = "orders"
navigation = false
setColumnExpressions("OrderID","OrderDate","RequiredDate","ShippedDate","CustomerID");
setColumnProperty("CustomerID", "foreignKey", true);
setColumnProperty("CustomerID", "display", false);
setColumnProperty("OrderDate", "filter", true);
addLinkedControl( orderDetails )
}
with (customers)
{
sql = "select customerid, companyname from customers where city = ? order by companyname";
parameters = {country : ""}
addLinkedControl(orders)
}
with (cities)
{
sql = "select distinct city from customers where country = ? order by city";
parameters = {country : ""}
addLinkedControl(customers)
}
with (countries)
{
connectionString = "SamplesDatabase"
sql = "select distinct country from customers where country is not null order by country"
addLinkedControl(cities)
initialize()
}
}
</script>