|
In addition to running stand-alone DbNetCombo can be integrated with DbNetGrid and DbNetEdit to provide a filtering mechanism.
|
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);
addLinkedControl( orderDetails )
}
with (customers)
{
sql = "select customerid, companyname from customers where city = ? order by 1";
parameters = {country : ""}
addLinkedControl(orders)
}
with (cities)
{
sql = "select distinct city from customers where country = ? order by 1";
parameters = {country : ""}
addLinkedControl(customers)
}
with (countries)
{
connectionString = "SamplesDatabase"
sql = "select distinct country from customers where country is not null order by 1"
addLinkedControl(cities)
initialize()
}
}
|