edf5932281a3f2b26ad50a45ccf6f9b91d91f026
[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 Rico.loadModule('Tree');\r
15 var tree1;\r
16 \r
17 // initialize tree\r
18 Rico.onLoad( function() {\r
19   tree1=new Rico.TreeControl("tree1", "CustTree.php");\r
20   tree1.atLoad();\r
21   tree1.returnValue=function(newVal) { Rico.$('TreeValue1').value=newVal; };\r
22   Rico.eventBind('TreeButton1', 'click', Rico.eventHandle(window,'TreeClick1'));\r
23 });\r
24 \r
25 function TreeClick1(e) {\r
26   if (Rico.visible(tree1.container)) {\r
27     tree1.close();\r
28   } else {\r
29     Rico.positionCtlOverIcon(tree1.container,Rico.$('TreeButton1'));\r
30     tree1.open();\r
31   }\r
32   Rico.eventStop(e);\r
33 }\r
34 </script>\r
35
36 </head>\r
37 \r
38 <body>
39 \r
40 <table id='explanation' border='0' cellpadding='0' cellspacing='5' style='clear:both'><tr valign='top'><td>\r
41 Base Library: \r
42 <script type='text/javascript'>\r
43 document.write(Rico.Lib+' '+Rico.LibVersion);\r
44 </script>\r
45 <hr>\r
46 <p>This example demonstrates a basic, pop-up tree control where the tree nodes are loaded via AJAX.\r
47 Only one item is selected from the tree at a time.\r
48 Data is from the Northwind customer table.\r
49 </td>\r
50 <td>\r
51 <script type="text/javascript"><!--\r
52 google_ad_client = "pub-7218597156507462";\r
53 /* 125x125, created 5/11/09 */\r
54 google_ad_slot = "9298106441";\r
55 google_ad_width = 125;\r
56 google_ad_height = 125;\r
57 //-->\r
58 </script>\r
59 <script type="text/javascript"\r
60 src="http://pagead2.googlesyndication.com/pagead/show_ads.js">\r
61 </script>\r
62 </td>\r
63 </tr></table>\r
64 \r
65 \r
66 <p><button id='TreeButton1'>Show Tree</button>\r
67 <p><input type='text' id='TreeValue1' size='6'> (selected customer id)\r
68 \r
69 <pre style='border:1px solid black;padding:3px;font-size:8pt;'>\r
70 Rico.onLoad( function() {\r
71   tree1=new Rico.TreeControl("tree1", "CustTree.php");\r
72   tree1.atLoad();\r
73   tree1.returnValue=function(newVal) { Rico.$('TreeValue1').value=newVal; };\r
74 });\r
75 </pre>\r
76 \r
77 </body>\r
78 </html>\r