RoadFlow2.1 临时演示

Default.aspx 3.5KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788
  1. <%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Default.aspx.cs" Inherits="WebForm.Controls.SelectIco.Default" %>
  2. <!DOCTYPE html>
  3. <html xmlns="http://www.w3.org/1999/xhtml">
  4. <head runat="server">
  5. <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
  6. <title></title>
  7. </head>
  8. <body style="padding:6px 5px 5px 5px;">
  9. <style type="text/css">
  10. .fileItem1 {text-align:center; float:left; display:inline-block; margin:3px 7px 3px 7px; cursor:pointer; width:93px; height:40px; overflow:hidden;}
  11. .fileItem1 span {line-height:25px; padding:2px 2px 2px 2px; -moz-user-select:none; color:#555;}
  12. .fileItem2 {text-align:center; }
  13. .fileItem2 span {background:#ccc; padding:2px 2px 2px 2px; color:#fff;}
  14. </style>
  15. <table width="100%" cellpadding="0" cellspacing="1" border="0" align="center">
  16. <tr>
  17. <td>
  18. <div id="selectList" style="border:1px solid #ccc; overflow:auto; height: 308px; width:100%; text-align:center;"></div>
  19. </td>
  20. </tr>
  21. <tr>
  22. <td align="center" valign="bottom" style="height:32px;">
  23. <input type="button" id="btnOK" onclick="OK_Click();" value=" 确 定 " class="mybutton" />
  24. <input type="button" id="btnCancel" onclick="new RoadUI.Window().close();" value=" 取 消 " class="mybutton" />
  25. </td>
  26. </tr>
  27. </table>
  28. <script type="text/javascript">
  29. var path = '<%=Request.QueryString["source"]%>';
  30. var id = '<%=Request.QueryString["id"]%>';
  31. var curSelectName = '';
  32. var curSelectPath = '';
  33. var icoTree = null;
  34. $(function ()
  35. {
  36. getFiles(path);
  37. });
  38. function OK_Click()
  39. {
  40. var win = new RoadUI.Window();
  41. var ele = win.getOpenerElement(id);
  42. if (ele != null && ele.size() > 0)
  43. {
  44. $(ele).val(curSelectPath);
  45. }
  46. win.close();
  47. }
  48. function getFiles(folderValue)
  49. {
  50. $.ajax({
  51. type: "get", url: "File.ashx?path=" + folderValue, dataType: "xml", async: true, cache: false,
  52. success: function (xml) { showFiles(xml); }
  53. });
  54. }
  55. var showFiles = function (xmlDom)
  56. {
  57. $element = $("#selectList");
  58. $element.children().remove();
  59. if (xmlDom == null || xmlDom.documentElement.childNodes.length == 0)
  60. {
  61. return;
  62. }
  63. nodeList = xmlDom.documentElement.childNodes;
  64. for (var i = 0; i < nodeList.length; i++)
  65. {
  66. var title = getNodeAtt(nodeList[i], "title");
  67. var path = getNodeAtt(nodeList[i], "path");
  68. var path1 = getNodeAtt(nodeList[i], "path1");
  69. if (path == "") { continue; }
  70. var html = '<div class="fileItem1" title="' + title + '"'
  71. + ' onclick="$(\'#selectList\').children().removeClass(\'fileItem2\');$(this).addClass(\'fileItem2\');curSelectName=\'' + title + '\';curSelectPath=\'' + path1 + '\';" '
  72. + ' ondblclick="OK_Click();" '
  73. + '><img src="' + path + '" border="0" /><br/><span onselectstart="return false" >' + title + '</span></div>';
  74. $element.append(html);
  75. }
  76. }
  77. var getNodeAtt = function (node, att)
  78. {
  79. try { return $.trim(node.attributes.getNamedItem(att).nodeValue); } catch (e) { return ''; }
  80. }
  81. </script>
  82. </body>
  83. </html>