Features

DbNetList is an web-based, database driven list control that can be used to present multi-column lists. Lists can be nested to present data in a tree-view style

Ease of use

DbNetList can be added to any web page (including classic ASP and HTML pages) with just a few lines of code. It it compatible with both Web Forms and MVC and can be implemented as a JavaScript object or an ASP.NET server-control.

jQuery(document).ready( init )

function init()
{
	var dbnetlist1 = new DbNetList("dbnetlist1");

	with (dbnetlist1)
	{
		connectionString = "SamplesDatabase"
		sql = "select CompanyName, City, Country from customers order by 1"
		headerRow = true
		rowSelection = true
		initialize()
	}
}

DbNetList implemented as a JavaScript object
 
			<DNL:DbNetList 
				id="DbNetList1" 
				runat="server" 
				ConnectionString = "SamplesDatabase"
				Sql = "select CompanyName, City, Country from customers order by 1"
				HeaderRow = "true"
				RowSelection = "true"
				Style="border:1pt solid silver"
				>
			</DNL:DbNetList>	
DbNetList implemented as an ASP.NET server-control

Presentation of data in DbNetList is very flexible. Date-time and numeric values can be formatted with standard .NET formatting masks and the style can be easlily modified with CSS.

Click to open
Integration

In addition to running stand-alone DbNetList can be linked with DbNetGrid and DbNetEdit to provide filtering mechanism.

Click to open
	jQuery(document).ready( init )

	function init()
	{
		var dbnetlist1 = new DbNetList("dbnetlist1");

		with (dbnetlist1)
		{
			connectionString = "SamplesDatabase"
			sql = "select distinct country from customers where country is not null order by 1"
			height = "400px"
			width = "200px"
			setColumnProperty("country","selectable",true)
			bind("onLinkSelected", selectOrders)
			addNestedList( configureCityList )
			initialize()
		}

		var dbnetgrid1 = new DbNetGrid("dbnetgrid1");

		with (dbnetgrid1)
		{
			connectionString = "SamplesDatabase"
			fromPart = "orders"
			setColumnExpressions("OrderID", "CustomerID", "OrderDate", "RequiredDate", "ShippedDate");   
			setColumnLabels("ID","Customer", "Ordered", "Required", "Shipped");   
			setColumnProperty("CustomerID","lookup","select customerid, companyname from customers");

			fixedFilterSql = "1=2"
			initialize()
		}
	}


	function configureCityList(list)
	{
		with (list)
		{
			sql = "select distinct city from customers where country = ?"
			parameters = {"country" : "" }
			bind("onLinkSelected", selectOrders)
			setColumnProperty("city","selectable",true)
			addNestedList( configureCustomersList )
		}
	}

	function configureCustomersList(list)
	{
		with (list)
		{
			sql = "select companyname, customerid from customers where city = ?"
			parameters = {"city" : "" }
			bind("onLinkSelected", selectOrders)
			setColumnProperty("companyname","selectable",true)
			setColumnProperty("customerid","display",false)
		}
	}


	function selectOrders(control, args)
	{
		var fixedFilterSql = "";
		var fixedFilterParams = {};

		switch(control.nestedLevel)
		{
			case 0:
				fixedFilterSql = "country = ?";
				fixedFilterParams = {country : jQuery( args.event.target ).text()};
				break;
			case 1:
				fixedFilterSql = "city = ?";
				fixedFilterParams = {city : jQuery( args.event.target ).text()};
				break;
			case 2:
				fixedFilterSql = "customerid = ?";
				fixedFilterParams = {customerid : jQuery( args.event.target ).parents( "tr:first" ).attr( "customerid" )};
				break;
		}

		fixedFilterSql = "customerid in (select customerid from customers where " + fixedFilterSql + ")";
		DbNetLink.components[ "dbnetgrid1" ].fixedFilterSql = fixedFilterSql;
		DbNetLink.components[ "dbnetgrid1" ].fixedFilterParams = fixedFilterParams;
		DbNetLink.components[ "dbnetgrid1" ].loadData();
	}