PageRenderTime 27ms CodeModel.GetById 26ms RepoModel.GetById 1ms app.codeStats 0ms

/plugins/org.openrico.rico.2.0/libraries/lib/rico/examples/asp/rtl/ex8.asp

https://github.com/victor-homyakov/frameworks
ASP | 136 lines | 110 code | 17 blank | 9 comment | 4 complexity | 02cfd05f7177a2c728810eaaa8feed9f MD5 | raw file
Possible License(s): BSD-3-Clause, LGPL-2.0, MIT
  1. <%@ LANGUAGE="VBSCRIPT" %>
  2. <% Response.CacheControl = "no-cache" %>
  3. <% Response.AddHeader "Pragma", "no-cache" %>
  4. <% Response.Expires = -1 %>
  5. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
  6. <html dir="rtl">
  7. <head>
  8. <title>LiveGrid Plus-Edit Example</title>
  9. <% sqltext="." ' force filtering to "on" in settings box %>
  10. <script src="../../../src/rico.js" type="text/javascript"></script>
  11. <link href="../../client/css/demo.css" type="text/css" rel="stylesheet" />
  12. <!-- #INCLUDE FILE = "applib.vbs" -->
  13. <!-- #INCLUDE FILE = "../../../plugins/asp/ricoLiveGridForms.vbs" -->
  14. <!-- #INCLUDE FILE = "chklang.vbs" -->
  15. <!-- #INCLUDE FILE = "settings.vbs" -->
  16. <script type='text/javascript'>
  17. Rico.loadModule('LiveGridForms');
  18. Rico.loadModule('Calendar');
  19. Rico.loadModule('Tree');
  20. <%
  21. setStyle
  22. setLang
  23. %>
  24. // Results of Rico.loadModule may not be immediately available!
  25. // In which case, "new Rico.CalendarControl" would fail if executed immediately.
  26. // Therefore, wrap it in a function.
  27. // ricoLiveGridForms will call orders_FormInit right before grid & form initialization.
  28. function orders_FormInit() {
  29. var cal=new Rico.CalendarControl("Cal");
  30. RicoEditControls.register(cal, Rico.imgDir+'calarrow.png');
  31. cal.addHoliday(25,12,0,'Christmas','#F55','white');
  32. cal.addHoliday(4,7,0,'Independence Day-US','#88F','white');
  33. cal.addHoliday(1,1,0,'New Years','#2F2','white');
  34. var CustTree=new Rico.TreeControl("CustomerTree","CustTree.asp");
  35. RicoEditControls.register(CustTree, Rico.imgDir+'dotbutton.gif');
  36. }
  37. </script>
  38. <style type="text/css">
  39. div.ricoLG_outerDiv thead .ricoLG_cell, div.ricoLG_outerDiv thead td, div.ricoLG_outerDiv thead th {
  40. height:2.5em;
  41. }
  42. </style>
  43. </head>
  44. <body>
  45. <%
  46. '************************************************************************************************************
  47. ' LiveGrid Plus-Edit Example
  48. '************************************************************************************************************
  49. ' Matt Brown
  50. '************************************************************************************************************
  51. if OpenGridForm(empty,"Orders") then
  52. if oForm.action="table" then
  53. %>
  54. <!-- #INCLUDE FILE = "menu.vbs" -->
  55. <%
  56. DisplayTable
  57. else
  58. DefineFields
  59. end if
  60. end if
  61. CloseApp
  62. sub DisplayTable()
  63. response.write "<table id='explanation' border='0' cellpadding='0' cellspacing='5' style='clear:both'><tr valign='top'><td>"
  64. GridSettingsForm
  65. response.write "</td><td>This example demonstrates how database records can be updated via AJAX. "
  66. response.write "Try selecting add, edit, or delete from the pop-up menu. "
  67. response.write "If you select add, then click the '...' button next to customer, you will see the Rico tree control."
  68. response.write "The actual database updates have been disabled for security reasons and result in an error."
  69. response.write "</td></tr></table>"
  70. oForm.options("borderWidth")=0
  71. GridSettingsTE oForm
  72. 'oForm.DebugFlag=true
  73. DefineFields
  74. 'response.write "<p><textarea id='orders_debugmsgs' rows='5' cols='80' style='font-size:smaller;'></textarea>"
  75. end sub
  76. sub DefineFields()
  77. oForm.options("RecordName")="Order"
  78. 'oForm.options("showSaveMsg")="full"
  79. oForm.AddPanel "Basic Info"
  80. oForm.AddEntryField "OrderID","Order ID","B","<auto>"
  81. oForm.ConfirmDeleteColumn
  82. oForm.CurrentField("width")=50
  83. oForm.SortAsc
  84. oForm.AddEntryField "CustomerID","Customer","CL",""
  85. oForm.CurrentField("SelectCtl")="CustomerTree"
  86. oForm.CurrentField("SelectSql")="select CustomerID,CompanyName from Customers order by CompanyName"
  87. oForm.CurrentField("InsertOnly")=true ' do not allow customer to be changed once an order is entered
  88. oForm.CurrentField("width")=160
  89. oForm.AddEntryField "EmployeeID","Sales Person","SL",""
  90. oForm.CurrentField("SelectSql")="select EmployeeID," & oDB.concat(Array("LastName","', '","FirstName"),false) & " from Employees order by LastName,FirstName"
  91. oForm.CurrentField("width")=140
  92. oForm.AddEntryField "OrderDate","Order Date","D",Date()
  93. oForm.CurrentField("SelectCtl")="Cal"
  94. oForm.CurrentField("width")=90
  95. oForm.AddEntryField "RequiredDate","Required Date","D",Date()
  96. oForm.CurrentField("SelectCtl")="Cal"
  97. oForm.CurrentField("width")=90
  98. oForm.AddCalculatedField "select sum(UnitPrice*Quantity*(1.0-Discount)) from order_details d where d.OrderID=t.OrderID","Net Sale"
  99. oForm.CurrentField("format")="DOLLAR"
  100. oForm.CurrentField("width")=80
  101. oForm.AddPanel "Ship To"
  102. oForm.AddEntryField "ShipName","Name","B",""
  103. oForm.CurrentField("width")=140
  104. oForm.AddEntryField "ShipAddress","Address","B",""
  105. oForm.CurrentField("width")=140
  106. oForm.AddEntryField "ShipCity","City","B",""
  107. oForm.CurrentField("width")=120
  108. oForm.AddEntryField "ShipRegion","Region","T",""
  109. oForm.CurrentField("width")=60
  110. oForm.AddEntryField "ShipPostalCode","Postal Code","T",""
  111. oForm.CurrentField("width")=100
  112. oForm.AddEntryField "ShipCountry","Country","N",""
  113. oForm.CurrentField("width")=100
  114. 'oForm.AutoInit=false
  115. oForm.DisplayPage
  116. end sub
  117. %>
  118. </body>
  119. </html>