Updated LoadRicoClient for asp and php, so all asp and php examples are working again...
[infodrom/rico3] / examples / php / tree1.php
1 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">\r
2 <html>\r
3 <head>\r
4 <meta http-equiv="Content-Type" content="text/html;charset=utf-8">
5 <title>Rico-Tree Control</title>\r
6
7 <?php\r
8 require "LoadRicoClient.php";\r
9 ?>\r
10 \r
11 <link href="../demo.css" type="text/css" rel="stylesheet" />\r
12 \r
13 <script type='text/javascript'>\r
14 var tree1;\r
15 \r
16 // initialize tree\r
17 Rico.onLoad( function() {\r
18   tree1=new Rico.TreeControl("tree1", "CustTree.php");\r
19   tree1.atLoad();\r
20   tree1.returnValue=function(newVal) { Rico.$('TreeValue1').value=newVal; };\r
21   Rico.eventBind('TreeButton1', 'click', Rico.eventHandle(window,'TreeClick1'));\r
22 });\r
23 \r
24 function TreeClick1(e) {\r
25   if (Rico.visible(tree1.container)) {\r
26     tree1.close();\r
27   } else {\r
28     Rico.positionCtlOverIcon(tree1.container,Rico.$('TreeButton1'));\r
29     tree1.open();\r
30   }\r
31   Rico.eventStop(e);\r
32 }\r
33 </script>\r
34
35 </head>\r
36 \r
37 <body>
38 \r
39 <table id='explanation' border='0' cellpadding='0' cellspacing='5' style='clear:both'><tr valign='top'><td>\r
40 Base Library: \r
41 <script type='text/javascript'>\r
42 document.write(Rico.Lib+' '+Rico.LibVersion);\r
43 </script>\r
44 <hr>\r
45 <p>This example demonstrates a basic, pop-up tree control where the tree nodes are loaded via AJAX.\r
46 Only one item is selected from the tree at a time.\r
47 Data is from the Northwind customer table.\r
48 </td>\r
49 <td>\r
50 <?php\r
51 require "info.php";\r
52 ?>\r
53 </td>\r
54 </tr></table>\r
55 \r
56 \r
57 <p><button id='TreeButton1'>Show Tree</button>\r
58 <p><input type='text' id='TreeValue1' size='6'> (selected customer id)\r
59 \r
60 <pre style='border:1px solid black;padding:3px;font-size:8pt;'>\r
61 Rico.onLoad( function() {\r
62   tree1=new Rico.TreeControl("tree1", "CustTree.php");\r
63   tree1.atLoad();\r
64   tree1.returnValue=function(newVal) { Rico.$('TreeValue1').value=newVal; };\r
65 });\r
66 </pre>\r
67 \r
68 </body>\r
69 </html>\r