--- /dev/null
+<%@ Page Language="VB" ResponseEncoding="iso-8859-1" %>\r
+<%@ Register TagPrefix="Rico" Assembly="Rico" NameSpace="Rico" %>\r
+<%@ Register TagPrefix="My" TagName="dbLib" Src="dbConnect.ascx" %>\r
+<My:dbLib id='app' runat='server' />\r
+\r
+<script runat="server">\r
+\r
+Sub Page_Load(Sender As object, e As EventArgs)\r
+ Session.Timeout=60\r
+ if app.OpenGrid(customer,"contextmenu") then\r
+ app.SetGridOptions(order,"contextmenu")\r
+ app.SetGridOptions(detail,"contextmenu")\r
+ order.sendDebugMsgs=true\r
+ order.LogSqlOnError=true\r
+ detail.sendDebugMsgs=true\r
+ detail.LogSqlOnError=true\r
+ end if\r
+End Sub\r
+\r
+</script>\r
+\r
+\r
+\r
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">\r
+<html>\r
+<head>\r
+<title>Rico LiveGrid-3 Grid Example</title>\r
+\r
+<Rico:LoadClient checkQueryString='true' runat='server' />\r
+<link href="../demo.css" type="text/css" rel="stylesheet" />\r
+\r
+<script type="text/javascript">\r
+\r
+function MeasureLayout() {\r
+ var c=Rico.select('div.gridcontainer');\r
+ var msg='';\r
+ for (var i=0; i < c.length; i++)\r
+ msg+='Container'+i+': offsetHeight='+c[i].offsetHeight+' scrollHeight='+c[i].scrollHeight+'\n';\r
+ alert(msg);\r
+}\r
+\r
+function customerDrillDown(e) {
+ var cell=Rico.eventElement(e);
+ cell=Rico.getParentByTagName(cell,'div','ricoLG_cell');\r
+ if (!cell) return;\r
+ Rico.eventStop(e);
+ var winIdx=customer['grid'].winCellIndex(cell);\r
+ var dataIdx=customer['grid'].datasetIndex(cell);\r
+ if (!dataIdx.onBlankRow) {\r
+ customer['grid'].highlight(winIdx);\r
+ var custid=customer['grid'].columns[0].getValue(winIdx.row);\r
+ Rico.$("order_caption").innerHTML='Orders for '+custid;\r
+ Rico.$("detail_caption").innerHTML="";\r
+ order['grid'].columns[0].setSystemFilter("EQ",custid);\r
+ detail['grid'].resetContents();\r
+ }\r
+ return false;
+}\r
+\r
+function orderDrillDown(e) {
+ var cell=Rico.eventElement(e);
+ cell=Rico.getParentByTagName(cell,'div','ricoLG_cell');\r
+ if (!cell) return;\r
+ Rico.eventStop(e);
+ var winIdx=order['grid'].winCellIndex(cell);\r
+ var dataIdx=order['grid'].datasetIndex(cell);\r
+ if (!dataIdx.onBlankRow) {\r
+ order['grid'].highlight(winIdx);\r
+ var orderid=order['grid'].columns[1].getValue(winIdx.row);\r
+ Rico.$("detail_caption").innerHTML='Order #'+orderid;\r
+ detail['grid'].columns[0].setSystemFilter("EQ",orderid);\r
+ }\r
+ return false;
+}\r
+\r
+function detailDataMenu(objCell,onBlankRow) {\r
+ return !onBlankRow;\r
+}\r
+\r
+</script>\r
+\r
+<style type="text/css">\r
+ html, body {\r
+ height:96%;\r
+ margin: 0px;\r
+ padding: 0px;\r
+ border: none;\r
+ }\r
+\r
+\r
+.gridcontainer {\r
+ margin-left:5px;\r
+ width:70%;\r
+ overflow:visible;\r
+ float: left;\r
+ font-size: 8pt !important;\r
+}\r
+\r
+#explanation {\r
+ overflow:auto;\r
+ height:99%;\r
+ width:25%;\r
+ font-size:8pt;\r
+ font-family:Verdana, Arial, Helvetica, sans-serif;\r
+ float: left;\r
+ padding: 5px;\r
+}\r
+\r
+div.ricoLG_cell {\r
+ font-size: 8pt;\r
+ height: 12px;\r
+ white-space: nowrap;\r
+}\r
+</style>\r
+\r
+</head>\r
+\r
+\r
+\r
+<body>\r
+\r
+<div id='explanation'>\r
+Base Library: \r
+<script type='text/javascript'>\r
+document.write(Rico.Lib+' '+Rico.LibVersion);\r
+</script>\r
+<hr>\r
+<p>Unlike the other examples, grid menus are activated in this example\r
+by <strong>right-clicking</strong> on a grid (ctrl-click in Opera, Konqueror, or Safari). \r
+<p>To filter: right-click \r
+on the value that you would like to use as the basis for filtering, \r
+then select the desired filtering method from the pop-up menu.\r
+<p>Right-click anywhere in a column to see sort, hide, and show options.\r
+<p><strong>Double-click</strong> on a row to see all orders for that customer.\r
+Double-click on an order to see the line items for that order.\r
+<p>Drag the edge of a column heading to resize a column.\r
+<!--\r
+<p><button onclick='MeasureLayout();'>Measure Grid Containers</button>\r
+-->\r
+</div>\r
+\r
+<div class='gridcontainer' style='height:39%'>\r
+\r
+<Rico:LiveGrid runat='server' id='customer' caption='Customers' rows='-4' frozenColumns='2' TableName='customers' DefaultSort='CustomerID' menuEvent='contextmenu' DisplayTimer='false' highlightElem='menuRow' dblclick="Rico.eventHandle(window,'customerDrillDown')">\r
+ <Rico:Column runat='server' heading='Customer#' colname='CustomerID' width='60' />\r
+ <Rico:Column runat='server' heading='Company' colname='CompanyName' width='150' />\r
+ <Rico:Column runat='server' heading='Contact' colname='ContactName' width='115' />\r
+ <Rico:Column runat='server' heading='Address' colname='Address' width='130' />\r
+ <Rico:Column runat='server' heading='City' colname='City' width='90' />\r
+ <Rico:Column runat='server' heading='Region' colname='Region' width='60' />\r
+ <Rico:Column runat='server' heading='Postal Code' colname='PostalCode' width='90' />\r
+ <Rico:Column runat='server' heading='Country' colname='Country' width='100' />\r
+ <Rico:Column runat='server' heading='Phone' colname='Phone' width='115' />\r
+ <Rico:Column runat='server' heading='Fax' colname='Fax' width='115' />\r
+</Rico:LiveGrid>\r
+\r
+</div>\r
+<div class='gridcontainer' style='height:30%'>\r
+\r
+<Rico:LiveGrid runat='server' id='order' caption='' rows='-4' prefetchBuffer='false' TableName='orders' DefaultSort='OrderID' menuEvent='contextmenu' DisplayTimer='false' highlightElem='menuRow' dblclick="Rico.eventHandle(window,'orderDrillDown')">\r
+ <Rico:Column runat='server' heading='Customer#' colname='CustomerID' width='60' canSort='false' visible='false'/>\r
+ <Rico:Column runat='server' heading='Order#' colname='OrderID' width='60' />\r
+ <Rico:Column runat='server' heading='Ship Name' colname='ShipName' width='150' />\r
+ <Rico:Column runat='server' heading='Ship City' colname='ShipCity' width='80' />\r
+ <Rico:Column runat='server' heading='Ship Country' colname='ShipCountry' width='90' />\r
+ <Rico:Column runat='server' heading='Order Date' colname='OrderDate' width='100' datatype='date' />\r
+ <Rico:Column runat='server' heading='Ship Date' colname='ShippedDate' width='100' datatype='date' />\r
+</Rico:LiveGrid>\r
+\r
+</div>\r
+<div class='gridcontainer' style='height:30%'>\r
+\r
+<Rico:LiveGrid runat='server' id='detail' caption='' rows='-4' prefetchBuffer='false' TableName='order_details' menuEvent='contextmenu' DisplayTimer='false' highlightElem='menuRow'>\r
+ <Rico:AltTable runat='server' TblName='products' TblAlias='p' JoinCondition='t.ProductId=p.ProductId' />\r
+ <Rico:Column runat='server' heading='Order#' colname='OrderID' width='60' canSort='false' visible='false' />\r
+ <Rico:Column runat='server' heading='Description' colname='ProductName' width='150' AltTable='products' />\r
+ <Rico:Column runat='server' heading='Unit Quantity' colname='QuantityPerUnit' width='125' AltTable='products' />\r
+ <Rico:Column runat='server' heading='Unit Price' colname='UnitPrice' width='80' format='Dollar' AltTable='products' />\r
+ <Rico:Column runat='server' heading='Qty' colname='Quantity' width='50' format='Qty' />\r
+ <Rico:Column runat='server' heading='Total' formula='t.UnitPrice*t.Quantity' width='80' format='Dollar' />\r
+ <Rico:Column runat='server' heading='Discount' colname='Discount' width='80' format='Percent' />\r
+ <Rico:Column runat='server' heading='Net Price' formula='t.UnitPrice*t.Quantity*(1.0-Discount)' width='90' format='Dollar' />\r
+</Rico:LiveGrid>\r
+\r
+</div>\r
+\r
+</body>\r
+</html>\r