1 <%@ LANGUAGE="VBSCRIPT" %>
\r
2 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
\r
5 <title>Rico LiveGrid-Example 2</title>
\r
7 <!-- #INCLUDE FILE = "LoadRicoClient.asp" -->
\r
12 id=trim(request.querystring("id"))
\r
13 sqltext="select OrderID,CustomerID,ShipName,ShipCity,ShipCountry,OrderDate,ShippedDate from orders order by OrderID"
\r
14 if len(id)=5 then sqltext=sqltext & " where CustomerID='" & id & "'"
\r
15 session.contents("ex2")=sqltext
\r
18 <link href="../demo.css" type="text/css" rel="stylesheet" />
\r
19 <script type='text/javascript'>
\r
20 Rico.loadModule('LiveGridAjax','LiveGridMenu');
\r
22 var orderGrid,buffer;
\r
24 Rico.onLoad( function() {
\r
26 menuEvent : 'click',
\r
28 highlightElem: 'cursorRow',
\r
29 columnSpecs : [,,,,,{type:'date'},{type:'date'}]
\r
31 buffer=new Rico.Buffer.AjaxSQL('ricoQuery.asp', {fmt:'json', TimeOut:<%=Session.Timeout%>});
\r
32 orderGrid=new Rico.LiveGrid ('ex2', buffer, opts);
\r
33 orderGrid.menu = new Rico.GridMenu({});
\r
38 <style type="text/css">
\r
47 <div id='explanation'>
\r
49 <script type='text/javascript'>
\r
50 document.write(Rico.Lib+' '+Rico.LibVersion);
\r
53 This example uses AJAX to fetch order data, as required, from the server.
\r
54 Notice how the number of visible rows is set automatically based
\r
55 on the size of the window. Try the different grid styles that
\r
57 Click on a cell to see available actions.
\r
58 <a href='ricoQuery.asp?id=ex2&offset=0&page_size=10&_fmt=json'>View the AJAX response (JSON)</a>
\r
59 (requires JSONview or similar extension in FF).
\r
62 <p class="ricoBookmark"><span id='ex2_timer' class='ricoSessionTimer'></span><span id="ex2_bookmark"> </span></p>
\r
63 <table id="ex2" class="ricoLiveGrid" cellspacing="0" cellpadding="0">
\r
65 <col style='width:40px;' >
\r
66 <col style='width:60px;' >
\r
67 <col style='width:150px;'>
\r
68 <col style='width:80px;' >
\r
69 <col style='width:90px;' >
\r
70 <col style='width:100px;'>
\r
71 <col style='width:100px;'>
\r
78 <th>Ship Country</th>
\r
84 <textarea id='ex2_debugmsgs' rows='5' cols='80'></textarea>
\r
85 <script type='text/javascript'>
\r
86 Rico.setDebugArea('ex2_debugmsgs');
\r