X-Git-Url: http://git.ithinksw.org/extjs.git/blobdiff_plain/25ef3491bd9ae007ff1fc2b0d7943e6eaaccf775..6e39d509471fe9b4e2660e0d1631b350d0c66f40:/docs/source/TreeNodeUI.html diff --git a/docs/source/TreeNodeUI.html b/docs/source/TreeNodeUI.html index 160c1a1b..84c32269 100644 --- a/docs/source/TreeNodeUI.html +++ b/docs/source/TreeNodeUI.html @@ -1,17 +1,12 @@ - - - The source code - - - - -
/*!
- * Ext JS Library 3.0.3
- * Copyright(c) 2006-2009 Ext JS, LLC
- * licensing@extjs.com
- * http://www.extjs.com/license
- */
-
/** + + + + The source code + + + + +
/** * @class Ext.tree.TreeNodeUI * This class provides the default UI implementation for Ext TreeNodes. * The TreeNode UI implementation is separate from the @@ -61,9 +56,9 @@ Ext.tree.TreeNodeUI.prototype = { // private onDisableChange : function(node, state){ this.disabled = state; - if (this.checkbox) { - this.checkbox.disabled = state; - } + if (this.checkbox) { + this.checkbox.disabled = state; + } if(state){ this.addClass("x-tree-node-disabled"); }else{ @@ -248,8 +243,8 @@ Ext.tree.TreeNodeUI.prototype = { // private onCheckChange : function(){ var checked = this.checkbox.checked; - // fix for IE6 - this.checkbox.defaultChecked = checked; + // fix for IE6 + this.checkbox.defaultChecked = checked; this.node.attributes.checked = checked; this.fireEvent('checkchange', this.node, checked); }, @@ -376,7 +371,10 @@ Ext.tree.TreeNodeUI.prototype = { return this.ctNode; }, - // private +
/** + * Returns the element which encapsulates this node. + * @return {HtmlElement} The DOM element. The default implementation uses a <li>. + */ getEl : function(){ return this.wrap; }, @@ -439,10 +437,10 @@ Ext.tree.TreeNodeUI.prototype = { // add some indent caching, this helps performance when rendering a large tree this.indentMarkup = n.parentNode ? n.parentNode.ui.getChildIndent() : ''; - var cb = typeof a.checked == 'boolean'; - - var href = a.href ? a.href : Ext.isGecko ? "" : "#"; - var buf = ['
  • ', + var cb = Ext.isBoolean(a.checked), + nel, + href = a.href ? a.href : Ext.isGecko ? "" : "#", + buf = ['
  • ', '',this.indentMarkup,"", '', '', @@ -452,7 +450,6 @@ Ext.tree.TreeNodeUI.prototype = { '', "
  • "].join(''); - var nel; if(bulkRender !== true && n.nextSibling && (nel = n.nextSibling.ui.getEl())){ this.wrap = Ext.DomHelper.insertHtml("beforeBegin", nel, buf); }else{ @@ -468,8 +465,8 @@ Ext.tree.TreeNodeUI.prototype = { var index = 3; if(cb){ this.checkbox = cs[3]; - // fix for IE6 - this.checkbox.defaultChecked = this.checkbox.checked; + // fix for IE6 + this.checkbox.defaultChecked = this.checkbox.checked; index++; } this.anchor = cs[index]; @@ -512,9 +509,11 @@ Ext.tree.TreeNodeUI.prototype = { // private updateExpandIcon : function(){ if(this.rendered){ - var n = this.node, c1, c2; - var cls = n.isLast() ? "x-tree-elbow-end" : "x-tree-elbow"; - var hasChild = n.hasChildNodes(); + var n = this.node, + c1, + c2, + cls = n.isLast() ? "x-tree-elbow-end" : "x-tree-elbow", + hasChild = n.hasChildNodes(); if(hasChild || n.attributes.expandable){ if(n.expanded){ cls += "-minus"; @@ -559,8 +558,8 @@ Ext.tree.TreeNodeUI.prototype = { // private getChildIndent : function(){ if(!this.childIndent){ - var buf = []; - var p = this.node; + var buf = [], + p = this.node; while(p){ if(!p.isRoot || (p.isRoot && p.ownerTree.rootVisible)){ if(!p.isLast()) { @@ -579,8 +578,8 @@ Ext.tree.TreeNodeUI.prototype = { // private renderIndent : function(){ if(this.rendered){ - var indent = ""; - var p = this.node.parentNode; + var indent = "", + p = this.node.parentNode; if(p){ indent = p.ui.getChildIndent(); } @@ -596,23 +595,14 @@ Ext.tree.TreeNodeUI.prototype = { if(this.elNode){ Ext.dd.Registry.unregister(this.elNode.id); } - delete this.elNode; - delete this.ctNode; - delete this.indentNode; - delete this.ecNode; - delete this.iconNode; - delete this.checkbox; - delete this.anchor; - delete this.textNode; - if (this.holder){ - delete this.wrap; - Ext.removeNode(this.holder); - delete this.holder; - }else{ - Ext.removeNode(this.wrap); - delete this.wrap; - } + Ext.each(['textnode', 'anchor', 'checkbox', 'indentNode', 'ecNode', 'iconNode', 'elNode', 'ctNode', 'wrap', 'holder'], function(el){ + if(this[el]){ + Ext.fly(this[el]).remove(); + delete this[el]; + } + }, this); + delete this.node; } }; @@ -636,6 +626,6 @@ Ext.tree.RootTreeNodeUI = Ext.extend(Ext.tree.TreeNodeUI, { }, collapse : Ext.emptyFn, expand : Ext.emptyFn -});
    - +});
    + \ No newline at end of file