Web UI for ARGUS server
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

116 lines
4.4 KiB

6 years ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
  1. <html>
  2. <head>
  3. <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  4. <title>The source code</title>
  5. <link href="../resources/prettify/prettify.css" type="text/css" rel="stylesheet" />
  6. <script type="text/javascript" src="../resources/prettify/prettify.js"></script>
  7. </head>
  8. <body onload="prettyPrint();">
  9. <pre class="prettyprint lang-js">/*!
  10. * Ext JS Library 3.3.1
  11. * Copyright(c) 2006-2010 Sencha Inc.
  12. * licensing@sencha.com
  13. * http://www.sencha.com/license
  14. */
  15. <div id="cls-Ext.ux.tree.TreeGridNodeUI"></div>/**
  16. * @class Ext.ux.tree.TreeGridNodeUI
  17. * @extends Ext.tree.TreeNodeUI
  18. */
  19. Ext.ux.tree.TreeGridNodeUI = Ext.extend(Ext.tree.TreeNodeUI, {
  20. isTreeGridNodeUI: true,
  21. renderElements : function(n, a, targetNode, bulkRender){
  22. var t = n.getOwnerTree(),
  23. cols = t.columns,
  24. c = cols[0],
  25. i, buf, len;
  26. this.indentMarkup = n.parentNode ? n.parentNode.ui.getChildIndent() : '';
  27. buf = [
  28. '<tbody class="x-tree-node">',
  29. '<tr ext:tree-node-id="', n.id ,'" class="x-tree-node-el x-tree-node-leaf ', a.cls, '">',
  30. '<td class="x-treegrid-col">',
  31. '<span class="x-tree-node-indent">', this.indentMarkup, "</span>",
  32. '<img src="', this.emptyIcon, '" class="x-tree-ec-icon x-tree-elbow" />',
  33. '<img src="', a.icon || this.emptyIcon, '" class="x-tree-node-icon', (a.icon ? " x-tree-node-inline-icon" : ""), (a.iconCls ? " "+a.iconCls : ""), '" unselectable="on" />',
  34. '<a hidefocus="on" class="x-tree-node-anchor" href="', a.href ? a.href : '#', '" tabIndex="1" ',
  35. a.hrefTarget ? ' target="'+a.hrefTarget+'"' : '', '>',
  36. '<span unselectable="on">', (c.tpl ? c.tpl.apply(a) : a[c.dataIndex] || c.text), '</span></a>',
  37. '</td>'
  38. ];
  39. for(i = 1, len = cols.length; i < len; i++){
  40. c = cols[i];
  41. buf.push(
  42. '<td class="x-treegrid-col ', (c.cls ? c.cls : ''), '">',
  43. '<div unselectable="on" class="x-treegrid-text"', (c.align ? ' style="text-align: ' + c.align + ';"' : ''), '>',
  44. (c.tpl ? c.tpl.apply(a) : a[c.dataIndex]),
  45. '</div>',
  46. '</td>'
  47. );
  48. }
  49. buf.push(
  50. '</tr><tr class="x-tree-node-ct"><td colspan="', cols.length, '">',
  51. '<table class="x-treegrid-node-ct-table" cellpadding="0" cellspacing="0" style="table-layout: fixed; display: none; width: ', t.innerCt.getWidth() ,'px;"><colgroup>'
  52. );
  53. for(i = 0, len = cols.length; i<len; i++) {
  54. buf.push('<col style="width: ', (cols[i].hidden ? 0 : cols[i].width) ,'px;" />');
  55. }
  56. buf.push('</colgroup></table></td></tr></tbody>');
  57. if(bulkRender !== true && n.nextSibling && n.nextSibling.ui.getEl()){
  58. this.wrap = Ext.DomHelper.insertHtml("beforeBegin", n.nextSibling.ui.getEl(), buf.join(''));
  59. }else{
  60. this.wrap = Ext.DomHelper.insertHtml("beforeEnd", targetNode, buf.join(''));
  61. }
  62. this.elNode = this.wrap.childNodes[0];
  63. this.ctNode = this.wrap.childNodes[1].firstChild.firstChild;
  64. var cs = this.elNode.firstChild.childNodes;
  65. this.indentNode = cs[0];
  66. this.ecNode = cs[1];
  67. this.iconNode = cs[2];
  68. this.anchor = cs[3];
  69. this.textNode = cs[3].firstChild;
  70. },
  71. // private
  72. animExpand : function(cb){
  73. this.ctNode.style.display = "";
  74. Ext.ux.tree.TreeGridNodeUI.superclass.animExpand.call(this, cb);
  75. }
  76. });
  77. Ext.ux.tree.TreeGridRootNodeUI = Ext.extend(Ext.tree.TreeNodeUI, {
  78. isTreeGridNodeUI: true,
  79. // private
  80. render : function(){
  81. if(!this.rendered){
  82. this.wrap = this.ctNode = this.node.ownerTree.innerCt.dom;
  83. this.node.expanded = true;
  84. }
  85. if(Ext.isWebKit) {
  86. // weird table-layout: fixed issue in webkit
  87. var ct = this.ctNode;
  88. ct.style.tableLayout = null;
  89. (function() {
  90. ct.style.tableLayout = 'fixed';
  91. }).defer(1);
  92. }
  93. },
  94. destroy : function(){
  95. if(this.elNode){
  96. Ext.dd.Registry.unregister(this.elNode.id);
  97. }
  98. delete this.node;
  99. },
  100. collapse : Ext.emptyFn,
  101. expand : Ext.emptyFn
  102. });</pre>
  103. </body>
  104. </html>