Web Interface For Lite Argus Control modules
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.

685 lines
20 KiB

​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
  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.tree.TreeNodeUI"></div>/**
  16. * @class Ext.tree.TreeNodeUI
  17. * This class provides the default UI implementation for Ext TreeNodes.
  18. * The TreeNode UI implementation is separate from the
  19. * tree implementation, and allows customizing of the appearance of
  20. * tree nodes.<br>
  21. * <p>
  22. * If you are customizing the Tree's user interface, you
  23. * may need to extend this class, but you should never need to instantiate this class.<br>
  24. * <p>
  25. * This class provides access to the user interface components of an Ext TreeNode, through
  26. * {@link Ext.tree.TreeNode#getUI}
  27. */
  28. Ext.tree.TreeNodeUI = Ext.extend(Object, {
  29. constructor : function(node){
  30. Ext.apply(this, {
  31. node: node,
  32. rendered: false,
  33. animating: false,
  34. wasLeaf: true,
  35. ecc: 'x-tree-ec-icon x-tree-elbow',
  36. emptyIcon: Ext.BLANK_IMAGE_URL
  37. });
  38. },
  39. // private
  40. removeChild : function(node){
  41. if(this.rendered){
  42. this.ctNode.removeChild(node.ui.getEl());
  43. }
  44. },
  45. // private
  46. beforeLoad : function(){
  47. this.addClass("x-tree-node-loading");
  48. },
  49. // private
  50. afterLoad : function(){
  51. this.removeClass("x-tree-node-loading");
  52. },
  53. // private
  54. onTextChange : function(node, text, oldText){
  55. if(this.rendered){
  56. this.textNode.innerHTML = text;
  57. }
  58. },
  59. // private
  60. onIconClsChange : function(node, cls, oldCls){
  61. if(this.rendered){
  62. Ext.fly(this.iconNode).replaceClass(oldCls, cls);
  63. }
  64. },
  65. // private
  66. onIconChange : function(node, icon){
  67. if(this.rendered){
  68. //'<img src="', a.icon || this.emptyIcon, '" class="x-tree-node-icon',(a.icon ? " x-tree-node-inline-icon" : ""),(a.iconCls ? " "+a.iconCls : ""),'" unselectable="on" />',
  69. var empty = Ext.isEmpty(icon);
  70. this.iconNode.src = empty ? this.emptyIcon : icon;
  71. Ext.fly(this.iconNode)[empty ? 'removeClass' : 'addClass']('x-tree-node-inline-icon');
  72. }
  73. },
  74. // private
  75. onTipChange : function(node, tip, title){
  76. if(this.rendered){
  77. var hasTitle = Ext.isDefined(title);
  78. if(this.textNode.setAttributeNS){
  79. this.textNode.setAttributeNS("ext", "qtip", tip);
  80. if(hasTitle){
  81. this.textNode.setAttributeNS("ext", "qtitle", title);
  82. }
  83. }else{
  84. this.textNode.setAttribute("ext:qtip", tip);
  85. if(hasTitle){
  86. this.textNode.setAttribute("ext:qtitle", title);
  87. }
  88. }
  89. }
  90. },
  91. // private
  92. onHrefChange : function(node, href, target){
  93. if(this.rendered){
  94. this.anchor.href = this.getHref(href);
  95. if(Ext.isDefined(target)){
  96. this.anchor.target = target;
  97. }
  98. }
  99. },
  100. // private
  101. onClsChange : function(node, cls, oldCls){
  102. if(this.rendered){
  103. Ext.fly(this.elNode).replaceClass(oldCls, cls);
  104. }
  105. },
  106. // private
  107. onDisableChange : function(node, state){
  108. this.disabled = state;
  109. if (this.checkbox) {
  110. this.checkbox.disabled = state;
  111. }
  112. this[state ? 'addClass' : 'removeClass']('x-tree-node-disabled');
  113. },
  114. // private
  115. onSelectedChange : function(state){
  116. if(state){
  117. this.focus();
  118. this.addClass("x-tree-selected");
  119. }else{
  120. //this.blur();
  121. this.removeClass("x-tree-selected");
  122. }
  123. },
  124. // private
  125. onMove : function(tree, node, oldParent, newParent, index, refNode){
  126. this.childIndent = null;
  127. if(this.rendered){
  128. var targetNode = newParent.ui.getContainer();
  129. if(!targetNode){//target not rendered
  130. this.holder = document.createElement("div");
  131. this.holder.appendChild(this.wrap);
  132. return;
  133. }
  134. var insertBefore = refNode ? refNode.ui.getEl() : null;
  135. if(insertBefore){
  136. targetNode.insertBefore(this.wrap, insertBefore);
  137. }else{
  138. targetNode.appendChild(this.wrap);
  139. }
  140. this.node.renderIndent(true, oldParent != newParent);
  141. }
  142. },
  143. <div id="method-Ext.tree.TreeNodeUI-addClass"></div>/**
  144. * Adds one or more CSS classes to the node's UI element.
  145. * Duplicate classes are automatically filtered out.
  146. * @param {String/Array} className The CSS class to add, or an array of classes
  147. */
  148. addClass : function(cls){
  149. if(this.elNode){
  150. Ext.fly(this.elNode).addClass(cls);
  151. }
  152. },
  153. <div id="method-Ext.tree.TreeNodeUI-removeClass"></div>/**
  154. * Removes one or more CSS classes from the node's UI element.
  155. * @param {String/Array} className The CSS class to remove, or an array of classes
  156. */
  157. removeClass : function(cls){
  158. if(this.elNode){
  159. Ext.fly(this.elNode).removeClass(cls);
  160. }
  161. },
  162. // private
  163. remove : function(){
  164. if(this.rendered){
  165. this.holder = document.createElement("div");
  166. this.holder.appendChild(this.wrap);
  167. }
  168. },
  169. // private
  170. fireEvent : function(){
  171. return this.node.fireEvent.apply(this.node, arguments);
  172. },
  173. // private
  174. initEvents : function(){
  175. this.node.on("move", this.onMove, this);
  176. if(this.node.disabled){
  177. this.onDisableChange(this.node, true);
  178. }
  179. if(this.node.hidden){
  180. this.hide();
  181. }
  182. var ot = this.node.getOwnerTree();
  183. var dd = ot.enableDD || ot.enableDrag || ot.enableDrop;
  184. if(dd && (!this.node.isRoot || ot.rootVisible)){
  185. Ext.dd.Registry.register(this.elNode, {
  186. node: this.node,
  187. handles: this.getDDHandles(),
  188. isHandle: false
  189. });
  190. }
  191. },
  192. // private
  193. getDDHandles : function(){
  194. return [this.iconNode, this.textNode, this.elNode];
  195. },
  196. <div id="method-Ext.tree.TreeNodeUI-hide"></div>/**
  197. * Hides this node.
  198. */
  199. hide : function(){
  200. this.node.hidden = true;
  201. if(this.wrap){
  202. this.wrap.style.display = "none";
  203. }
  204. },
  205. <div id="method-Ext.tree.TreeNodeUI-show"></div>/**
  206. * Shows this node.
  207. */
  208. show : function(){
  209. this.node.hidden = false;
  210. if(this.wrap){
  211. this.wrap.style.display = "";
  212. }
  213. },
  214. // private
  215. onContextMenu : function(e){
  216. if (this.node.hasListener("contextmenu") || this.node.getOwnerTree().hasListener("contextmenu")) {
  217. e.preventDefault();
  218. this.focus();
  219. this.fireEvent("contextmenu", this.node, e);
  220. }
  221. },
  222. // private
  223. onClick : function(e){
  224. if(this.dropping){
  225. e.stopEvent();
  226. return;
  227. }
  228. if(this.fireEvent("beforeclick", this.node, e) !== false){
  229. var a = e.getTarget('a');
  230. if(!this.disabled && this.node.attributes.href && a){
  231. this.fireEvent("click", this.node, e);
  232. return;
  233. }else if(a && e.ctrlKey){
  234. e.stopEvent();
  235. }
  236. e.preventDefault();
  237. if(this.disabled){
  238. return;
  239. }
  240. if(this.node.attributes.singleClickExpand && !this.animating && this.node.isExpandable()){
  241. this.node.toggle();
  242. }
  243. this.fireEvent("click", this.node, e);
  244. }else{
  245. e.stopEvent();
  246. }
  247. },
  248. // private
  249. onDblClick : function(e){
  250. e.preventDefault();
  251. if(this.disabled){
  252. return;
  253. }
  254. if(this.fireEvent("beforedblclick", this.node, e) !== false){
  255. if(this.checkbox){
  256. this.toggleCheck();
  257. }
  258. if(!this.animating && this.node.isExpandable()){
  259. this.node.toggle();
  260. }
  261. this.fireEvent("dblclick", this.node, e);
  262. }
  263. },
  264. onOver : function(e){
  265. this.addClass('x-tree-node-over');
  266. },
  267. onOut : function(e){
  268. this.removeClass('x-tree-node-over');
  269. },
  270. // private
  271. onCheckChange : function(){
  272. var checked = this.checkbox.checked;
  273. // fix for IE6
  274. this.checkbox.defaultChecked = checked;
  275. this.node.attributes.checked = checked;
  276. this.fireEvent('checkchange', this.node, checked);
  277. },
  278. // private
  279. ecClick : function(e){
  280. if(!this.animating && this.node.isExpandable()){
  281. this.node.toggle();
  282. }
  283. },
  284. // private
  285. startDrop : function(){
  286. this.dropping = true;
  287. },
  288. // delayed drop so the click event doesn't get fired on a drop
  289. endDrop : function(){
  290. setTimeout(function(){
  291. this.dropping = false;
  292. }.createDelegate(this), 50);
  293. },
  294. // private
  295. expand : function(){
  296. this.updateExpandIcon();
  297. this.ctNode.style.display = "";
  298. },
  299. // private
  300. focus : function(){
  301. if(!this.node.preventHScroll){
  302. try{this.anchor.focus();
  303. }catch(e){}
  304. }else{
  305. try{
  306. var noscroll = this.node.getOwnerTree().getTreeEl().dom;
  307. var l = noscroll.scrollLeft;
  308. this.anchor.focus();
  309. noscroll.scrollLeft = l;
  310. }catch(e){}
  311. }
  312. },
  313. <div id="method-Ext.tree.TreeNodeUI-toggleCheck"></div>/**
  314. * Sets the checked status of the tree node to the passed value, or, if no value was passed,
  315. * toggles the checked status. If the node was rendered with no checkbox, this has no effect.
  316. * @param {Boolean} value (optional) The new checked status.
  317. */
  318. toggleCheck : function(value){
  319. var cb = this.checkbox;
  320. if(cb){
  321. cb.checked = (value === undefined ? !cb.checked : value);
  322. this.onCheckChange();
  323. }
  324. },
  325. // private
  326. blur : function(){
  327. try{
  328. this.anchor.blur();
  329. }catch(e){}
  330. },
  331. // private
  332. animExpand : function(callback){
  333. var ct = Ext.get(this.ctNode);
  334. ct.stopFx();
  335. if(!this.node.isExpandable()){
  336. this.updateExpandIcon();
  337. this.ctNode.style.display = "";
  338. Ext.callback(callback);
  339. return;
  340. }
  341. this.animating = true;
  342. this.updateExpandIcon();
  343. ct.slideIn('t', {
  344. callback : function(){
  345. this.animating = false;
  346. Ext.callback(callback);
  347. },
  348. scope: this,
  349. duration: this.node.ownerTree.duration || .25
  350. });
  351. },
  352. // private
  353. highlight : function(){
  354. var tree = this.node.getOwnerTree();
  355. Ext.fly(this.wrap).highlight(
  356. tree.hlColor || "C3DAF9",
  357. {endColor: tree.hlBaseColor}
  358. );
  359. },
  360. // private
  361. collapse : function(){
  362. this.updateExpandIcon();
  363. this.ctNode.style.display = "none";
  364. },
  365. // private
  366. animCollapse : function(callback){
  367. var ct = Ext.get(this.ctNode);
  368. ct.enableDisplayMode('block');
  369. ct.stopFx();
  370. this.animating = true;
  371. this.updateExpandIcon();
  372. ct.slideOut('t', {
  373. callback : function(){
  374. this.animating = false;
  375. Ext.callback(callback);
  376. },
  377. scope: this,
  378. duration: this.node.ownerTree.duration || .25
  379. });
  380. },
  381. // private
  382. getContainer : function(){
  383. return this.ctNode;
  384. },
  385. <div id="method-Ext.tree.TreeNodeUI-getEl"></div>/**
  386. * Returns the element which encapsulates this node.
  387. * @return {HtmlElement} The DOM element. The default implementation uses a <code>&lt;li></code>.
  388. */
  389. getEl : function(){
  390. return this.wrap;
  391. },
  392. // private
  393. appendDDGhost : function(ghostNode){
  394. ghostNode.appendChild(this.elNode.cloneNode(true));
  395. },
  396. // private
  397. getDDRepairXY : function(){
  398. return Ext.lib.Dom.getXY(this.iconNode);
  399. },
  400. // private
  401. onRender : function(){
  402. this.render();
  403. },
  404. // private
  405. render : function(bulkRender){
  406. var n = this.node, a = n.attributes;
  407. var targetNode = n.parentNode ?
  408. n.parentNode.ui.getContainer() : n.ownerTree.innerCt.dom;
  409. if(!this.rendered){
  410. this.rendered = true;
  411. this.renderElements(n, a, targetNode, bulkRender);
  412. if(a.qtip){
  413. this.onTipChange(n, a.qtip, a.qtipTitle);
  414. }else if(a.qtipCfg){
  415. a.qtipCfg.target = Ext.id(this.textNode);
  416. Ext.QuickTips.register(a.qtipCfg);
  417. }
  418. this.initEvents();
  419. if(!this.node.expanded){
  420. this.updateExpandIcon(true);
  421. }
  422. }else{
  423. if(bulkRender === true) {
  424. targetNode.appendChild(this.wrap);
  425. }
  426. }
  427. },
  428. // private
  429. renderElements : function(n, a, targetNode, bulkRender){
  430. // add some indent caching, this helps performance when rendering a large tree
  431. this.indentMarkup = n.parentNode ? n.parentNode.ui.getChildIndent() : '';
  432. var cb = Ext.isBoolean(a.checked),
  433. nel,
  434. href = this.getHref(a.href),
  435. buf = ['<li class="x-tree-node"><div ext:tree-node-id="',n.id,'" class="x-tree-node-el x-tree-node-leaf x-unselectable ', a.cls,'" unselectable="on">',
  436. '<span class="x-tree-node-indent">',this.indentMarkup,"</span>",
  437. '<img alt="" src="', this.emptyIcon, '" class="x-tree-ec-icon x-tree-elbow" />',
  438. '<img alt="" src="', a.icon || this.emptyIcon, '" class="x-tree-node-icon',(a.icon ? " x-tree-node-inline-icon" : ""),(a.iconCls ? " "+a.iconCls : ""),'" unselectable="on" />',
  439. cb ? ('<input class="x-tree-node-cb" type="checkbox" ' + (a.checked ? 'checked="checked" />' : '/>')) : '',
  440. '<a hidefocus="on" class="x-tree-node-anchor" href="',href,'" tabIndex="1" ',
  441. a.hrefTarget ? ' target="'+a.hrefTarget+'"' : "", '><span unselectable="on">',n.text,"</span></a></div>",
  442. '<ul class="x-tree-node-ct" style="display:none;"></ul>',
  443. "</li>"].join('');
  444. if(bulkRender !== true && n.nextSibling && (nel = n.nextSibling.ui.getEl())){
  445. this.wrap = Ext.DomHelper.insertHtml("beforeBegin", nel, buf);
  446. }else{
  447. this.wrap = Ext.DomHelper.insertHtml("beforeEnd", targetNode, buf);
  448. }
  449. this.elNode = this.wrap.childNodes[0];
  450. this.ctNode = this.wrap.childNodes[1];
  451. var cs = this.elNode.childNodes;
  452. this.indentNode = cs[0];
  453. this.ecNode = cs[1];
  454. this.iconNode = cs[2];
  455. var index = 3;
  456. if(cb){
  457. this.checkbox = cs[3];
  458. // fix for IE6
  459. this.checkbox.defaultChecked = this.checkbox.checked;
  460. index++;
  461. }
  462. this.anchor = cs[index];
  463. this.textNode = cs[index].firstChild;
  464. },
  465. /**
  466. * @private Gets a normalized href for the node.
  467. * @param {String} href
  468. */
  469. getHref : function(href){
  470. return Ext.isEmpty(href) ? (Ext.isGecko ? '' : '#') : href;
  471. },
  472. <div id="method-Ext.tree.TreeNodeUI-getAnchor"></div>/**
  473. * Returns the &lt;a> element that provides focus for the node's UI.
  474. * @return {HtmlElement} The DOM anchor element.
  475. */
  476. getAnchor : function(){
  477. return this.anchor;
  478. },
  479. <div id="method-Ext.tree.TreeNodeUI-getTextEl"></div>/**
  480. * Returns the text node.
  481. * @return {HtmlNode} The DOM text node.
  482. */
  483. getTextEl : function(){
  484. return this.textNode;
  485. },
  486. <div id="method-Ext.tree.TreeNodeUI-getIconEl"></div>/**
  487. * Returns the icon &lt;img> element.
  488. * @return {HtmlElement} The DOM image element.
  489. */
  490. getIconEl : function(){
  491. return this.iconNode;
  492. },
  493. <div id="method-Ext.tree.TreeNodeUI-isChecked"></div>/**
  494. * Returns the checked status of the node. If the node was rendered with no
  495. * checkbox, it returns false.
  496. * @return {Boolean} The checked flag.
  497. */
  498. isChecked : function(){
  499. return this.checkbox ? this.checkbox.checked : false;
  500. },
  501. // private
  502. updateExpandIcon : function(){
  503. if(this.rendered){
  504. var n = this.node,
  505. c1,
  506. c2,
  507. cls = n.isLast() ? "x-tree-elbow-end" : "x-tree-elbow",
  508. hasChild = n.hasChildNodes();
  509. if(hasChild || n.attributes.expandable){
  510. if(n.expanded){
  511. cls += "-minus";
  512. c1 = "x-tree-node-collapsed";
  513. c2 = "x-tree-node-expanded";
  514. }else{
  515. cls += "-plus";
  516. c1 = "x-tree-node-expanded";
  517. c2 = "x-tree-node-collapsed";
  518. }
  519. if(this.wasLeaf){
  520. this.removeClass("x-tree-node-leaf");
  521. this.wasLeaf = false;
  522. }
  523. if(this.c1 != c1 || this.c2 != c2){
  524. Ext.fly(this.elNode).replaceClass(c1, c2);
  525. this.c1 = c1; this.c2 = c2;
  526. }
  527. }else{
  528. if(!this.wasLeaf){
  529. Ext.fly(this.elNode).replaceClass("x-tree-node-expanded", "x-tree-node-collapsed");
  530. delete this.c1;
  531. delete this.c2;
  532. this.wasLeaf = true;
  533. }
  534. }
  535. var ecc = "x-tree-ec-icon "+cls;
  536. if(this.ecc != ecc){
  537. this.ecNode.className = ecc;
  538. this.ecc = ecc;
  539. }
  540. }
  541. },
  542. // private
  543. onIdChange: function(id){
  544. if(this.rendered){
  545. this.elNode.setAttribute('ext:tree-node-id', id);
  546. }
  547. },
  548. // private
  549. getChildIndent : function(){
  550. if(!this.childIndent){
  551. var buf = [],
  552. p = this.node;
  553. while(p){
  554. if(!p.isRoot || (p.isRoot && p.ownerTree.rootVisible)){
  555. if(!p.isLast()) {
  556. buf.unshift('<img alt="" src="'+this.emptyIcon+'" class="x-tree-elbow-line" />');
  557. } else {
  558. buf.unshift('<img alt="" src="'+this.emptyIcon+'" class="x-tree-icon" />');
  559. }
  560. }
  561. p = p.parentNode;
  562. }
  563. this.childIndent = buf.join("");
  564. }
  565. return this.childIndent;
  566. },
  567. // private
  568. renderIndent : function(){
  569. if(this.rendered){
  570. var indent = "",
  571. p = this.node.parentNode;
  572. if(p){
  573. indent = p.ui.getChildIndent();
  574. }
  575. if(this.indentMarkup != indent){ // don't rerender if not required
  576. this.indentNode.innerHTML = indent;
  577. this.indentMarkup = indent;
  578. }
  579. this.updateExpandIcon();
  580. }
  581. },
  582. destroy : function(){
  583. if(this.elNode){
  584. Ext.dd.Registry.unregister(this.elNode.id);
  585. }
  586. Ext.each(['textnode', 'anchor', 'checkbox', 'indentNode', 'ecNode', 'iconNode', 'elNode', 'ctNode', 'wrap', 'holder'], function(el){
  587. if(this[el]){
  588. Ext.fly(this[el]).remove();
  589. delete this[el];
  590. }
  591. }, this);
  592. delete this.node;
  593. }
  594. });
  595. <div id="cls-Ext.tree.RootTreeNodeUI"></div>/**
  596. * @class Ext.tree.RootTreeNodeUI
  597. * This class provides the default UI implementation for <b>root</b> Ext TreeNodes.
  598. * The RootTreeNode UI implementation allows customizing the appearance of the root tree node.<br>
  599. * <p>
  600. * If you are customizing the Tree's user interface, you
  601. * may need to extend this class, but you should never need to instantiate this class.<br>
  602. */
  603. Ext.tree.RootTreeNodeUI = Ext.extend(Ext.tree.TreeNodeUI, {
  604. // private
  605. render : function(){
  606. if(!this.rendered){
  607. var targetNode = this.node.ownerTree.innerCt.dom;
  608. this.node.expanded = true;
  609. targetNode.innerHTML = '<div class="x-tree-root-node"></div>';
  610. this.wrap = this.ctNode = targetNode.firstChild;
  611. }
  612. },
  613. collapse : Ext.emptyFn,
  614. expand : Ext.emptyFn
  615. });</pre>
  616. </body>
  617. </html>