1 <%@ Page Language="VB" ResponseEncoding="iso-8859-1" %>
\r
2 <%@ Register TagPrefix="Rico" Assembly="Rico" NameSpace="Rico" %>
\r
3 <%@ Register TagPrefix="My" TagName="dbLib" Src="dbConnect.ascx" %>
\r
4 <My:dbLib id='app' runat='server' />
\r
6 <script runat="server">
\r
8 Sub Page_Load(Sender As object, e As EventArgs)
\r
10 if app.OpenGrid(customer, Rico.menuEvents.contextmenu) then
\r
11 app.SetGridOptions(order, Rico.menuEvents.contextmenu)
\r
12 app.SetGridOptions(detail, Rico.menuEvents.contextmenu)
\r
13 order.sendDebugMsgs=true
\r
14 order.LogSqlOnError=true
\r
15 detail.sendDebugMsgs=true
\r
16 detail.LogSqlOnError=true
\r
24 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
\r
27 <title>Rico LiveGrid-3 Grid Example</title>
\r
29 <Rico:LoadClient checkQueryString='true' runat='server' />
\r
30 <link href="../demo.css" type="text/css" rel="stylesheet" />
\r
32 <script type="text/javascript">
\r
34 function MeasureLayout() {
\r
35 var c=Rico.select('div.gridcontainer');
\r
37 for (var i=0; i < c.length; i++)
\r
38 msg+='Container'+i+': offsetHeight='+c[i].offsetHeight+' scrollHeight='+c[i].scrollHeight+'\n';
\r
42 function customerDrillDown(e) {
43 var cell=Rico.eventElement(e);
44 cell=Rico.getParentByTagName(cell,'div','ricoLG_cell');
\r
47 var winIdx=customer['grid'].winCellIndex(cell);
\r
48 var dataIdx=customer['grid'].datasetIndex(cell);
\r
49 if (!dataIdx.onBlankRow) {
\r
50 customer['grid'].highlight(winIdx);
\r
51 var custid=customer['grid'].columns[0].getValue(winIdx.row);
\r
52 Rico.$("order_caption").innerHTML='Orders for '+custid;
\r
53 Rico.$("detail_caption").innerHTML="";
\r
54 order['grid'].columns[0].setSystemFilter("EQ",custid);
\r
55 detail['grid'].resetContents();
\r
60 function orderDrillDown(e) {
61 var cell=Rico.eventElement(e);
62 cell=Rico.getParentByTagName(cell,'div','ricoLG_cell');
\r
65 var winIdx=order['grid'].winCellIndex(cell);
\r
66 var dataIdx=order['grid'].datasetIndex(cell);
\r
67 if (!dataIdx.onBlankRow) {
\r
68 order['grid'].highlight(winIdx);
\r
69 var orderid=order['grid'].columns[1].getValue(winIdx.row);
\r
70 Rico.$("detail_caption").innerHTML='Order #'+orderid;
\r
71 detail['grid'].columns[0].setSystemFilter("EQ",orderid);
\r
76 function detailDataMenu(objCell,onBlankRow) {
\r
82 <style type="text/css">
\r
96 font-size: 8pt !important;
\r
104 font-family:Verdana, Arial, Helvetica, sans-serif;
\r
116 <div id='explanation'>
\r
118 <script type='text/javascript'>
\r
119 document.write(Rico.Lib+' '+Rico.LibVersion);
\r
122 <p>Unlike the other examples, grid menus are activated in this example
\r
123 by <strong>right-clicking</strong> on a grid (ctrl-click in Opera, Konqueror, or Safari).
\r
124 <p>To filter: right-click
\r
125 on the value that you would like to use as the basis for filtering,
\r
126 then select the desired filtering method from the pop-up menu.
\r
127 <p>Right-click anywhere in a column to see sort, hide, and show options.
\r
128 <p><strong>Double-click</strong> on a row to see all orders for that customer.
\r
129 Double-click on an order to see the line items for that order.
\r
130 <p>Drag the edge of a column heading to resize a column.
\r
132 <p><button onclick='MeasureLayout();'>Measure Grid Containers</button>
\r
136 <div class='gridcontainer' style='height:39%'>
\r
138 <Rico:LiveGrid runat='server' id='customer' caption='Customers' rows='-4' frozenColumns='2' DefaultSort='CustomerID' menuEvent='contextmenu' DisplayTimer='false' highlightElem='menuRow' dblclick="Rico.eventHandle(window,'customerDrillDown')">
\r
139 <Rico:Style runat='server' StyleId="Default" fontsize="8" />
\r
140 <Rico:Table runat='server' TblName='customers' />
\r
141 <Rico:TableCol runat='server' heading='Cust ID' colname='CustomerID' width='60' />
\r
142 <Rico:TableCol runat='server' heading='Company' colname='CompanyName' width='150' />
\r
143 <Rico:TableCol runat='server' heading='Contact' colname='ContactName' width='115' />
\r
144 <Rico:TableCol runat='server' heading='Address' colname='Address' width='130' />
\r
145 <Rico:TableCol runat='server' heading='City' colname='City' width='90' />
\r
146 <Rico:TableCol runat='server' heading='Region' colname='Region' width='60' />
\r
147 <Rico:TableCol runat='server' heading='Postal Code' colname='PostalCode' width='90' />
\r
148 <Rico:TableCol runat='server' heading='Country' colname='Country' width='100' />
\r
149 <Rico:TableCol runat='server' heading='Phone' colname='Phone' width='115' />
\r
150 <Rico:TableCol runat='server' heading='Fax' colname='Fax' width='115' />
\r
154 <div class='gridcontainer' style='height:30%'>
\r
156 <Rico:LiveGrid runat='server' id='order' caption='' rows='-4' prefetchBuffer='false' DefaultSort='OrderID' menuEvent='contextmenu' DisplayTimer='false' highlightElem='menuRow' dblclick="Rico.eventHandle(window,'orderDrillDown')">
\r
157 <Rico:Style runat='server' StyleId="Default" fontsize="8" />
\r
158 <Rico:Table runat='server' TblName='orders' />
\r
159 <Rico:TableCol runat='server' heading='Cust ID' colname='CustomerID' width='60' canSort='false' visible='false' />
\r
160 <Rico:TableCol runat='server' heading='Order#' colname='OrderID' width='60' />
\r
161 <Rico:TableCol runat='server' heading='Ship Name' colname='ShipName' width='150' />
\r
162 <Rico:TableCol runat='server' heading='Ship City' colname='ShipCity' width='80' />
\r
163 <Rico:TableCol runat='server' heading='Ship Country' colname='ShipCountry' width='90' />
\r
164 <Rico:TableCol runat='server' heading='Order Date' colname='OrderDate' width='100' datatype='date' />
\r
165 <Rico:TableCol runat='server' heading='Ship Date' colname='ShippedDate' width='100' datatype='date' />
\r
169 <div class='gridcontainer' style='height:30%'>
\r
171 <Rico:LiveGrid runat='server' id='detail' caption='' rows='-4' prefetchBuffer='false' menuEvent='contextmenu' DisplayTimer='false' highlightElem='menuRow'>
\r
172 <Rico:Style runat='server' StyleId="Default" fontsize="8" />
\r
173 <Rico:Table runat='server' TblName='order_details' TblAlias='t' />
\r
174 <Rico:Table runat='server' TblName='products' TblAlias='p' JoinCondition='t.ProductId=p.ProductId' />
\r
175 <Rico:TableCol runat='server' heading='Order#' colname='OrderID' width='60' canSort='false' visible='false' />
\r
176 <Rico:TableCol runat='server' heading='Description' colname='ProductName' width='150' TblAlias='p' />
\r
177 <Rico:TableCol runat='server' heading='Unit Quantity' colname='QuantityPerUnit' width='125' TblAlias='p' />
\r
178 <Rico:TableCol runat='server' heading='Unit Price' colname='UnitPrice' width='80' datatype='Dollar' TblAlias='p' />
\r
179 <Rico:TableCol runat='server' heading='Qty' colname='Quantity' width='50' datatype='number' />
\r
180 <Rico:FormulaCol runat='server' heading='Total' formula='t.UnitPrice*t.Quantity' width='80' datatype='Dollar' />
\r
181 <Rico:TableCol runat='server' heading='Discount' colname='Discount' width='80' datatype='Percent' />
\r
182 <Rico:FormulaCol runat='server' heading='Net Price' formula='t.UnitPrice*t.Quantity*(1.0-Discount)' width='90' datatype='Dollar' />
\r