-Ext.data.Node = function(attributes){
- /**
- * The attributes supplied for the node. You can use this property to access any custom attributes you supplied.
- * @type {Object}
- */
- this.attributes = attributes || {};
- this.leaf = this.attributes.leaf;
- /**
- * The node id. @type String
- */
- this.id = this.attributes.id;
- if(!this.id){
- this.id = Ext.id(null, "xnode-");
- this.attributes.id = this.id;
- }
- /**
- * All child nodes of this node. @type Array
- */
- this.childNodes = [];
- if(!this.childNodes.indexOf){ // indexOf is a must
- this.childNodes.indexOf = function(o){
- for(var i = 0, len = this.length; i < len; i++){
- if(this[i] == o){
- return i;
- }
- }
- return -1;
- };
- }
- /**
- * The parent node for this node. @type Node
- */
- this.parentNode = null;
- /**
- * The first direct child node of this node, or null if this node has no child nodes. @type Node
- */
- this.firstChild = null;
- /**
- * The last direct child node of this node, or null if this node has no child nodes. @type Node
- */
- this.lastChild = null;
- /**
- * The node immediately preceding this node in the tree, or null if there is no sibling node. @type Node
- */
- this.previousSibling = null;
- /**
- * The node immediately following this node in the tree, or null if there is no sibling node. @type Node
- */
- this.nextSibling = null;
-
- this.addEvents({
- /**
- * @event append
- * Fires when a new child node is appended
- * @param {Tree} tree The owner tree
- * @param {Node} this This node
- * @param {Node} node The newly appended node
- * @param {Number} index The index of the newly appended node
- */
- "append" : true,
- /**
- * @event remove
- * Fires when a child node is removed
- * @param {Tree} tree The owner tree
- * @param {Node} this This node
- * @param {Node} node The removed node
- */
- "remove" : true,
- /**
- * @event move
- * Fires when this node is moved to a new location in the tree
- * @param {Tree} tree The owner tree
- * @param {Node} this This node
- * @param {Node} oldParent The old parent of this node
- * @param {Node} newParent The new parent of this node
- * @param {Number} index The index it was moved to
- */
- "move" : true,
- /**
- * @event insert
- * Fires when a new child node is inserted.
- * @param {Tree} tree The owner tree
- * @param {Node} this This node
- * @param {Node} node The child node inserted
- * @param {Node} refNode The child node the node was inserted before
- */
- "insert" : true,
- /**
- * @event beforeappend
- * Fires before a new child is appended, return false to cancel the append.
- * @param {Tree} tree The owner tree
- * @param {Node} this This node
- * @param {Node} node The child node to be appended
- */
- "beforeappend" : true,
- /**
- * @event beforeremove
- * Fires before a child is removed, return false to cancel the remove.
- * @param {Tree} tree The owner tree
- * @param {Node} this This node
- * @param {Node} node The child node to be removed
- */
- "beforeremove" : true,
- /**
- * @event beforemove
- * Fires before this node is moved to a new location in the tree. Return false to cancel the move.
- * @param {Tree} tree The owner tree
- * @param {Node} this This node
- * @param {Node} oldParent The parent of this node
- * @param {Node} newParent The new parent this node is moving to
- * @param {Number} index The index it is being moved to
- */
- "beforemove" : true,
- /**
- * @event beforeinsert
- * Fires before a new child is inserted, return false to cancel the insert.
- * @param {Tree} tree The owner tree
- * @param {Node} this This node
- * @param {Node} node The child node to be inserted
- * @param {Node} refNode The child node the node is being inserted before
- */
- "beforeinsert" : true
- });
- this.listeners = this.attributes.listeners;
- Ext.data.Node.superclass.constructor.call(this);
-};
-
-Ext.extend(Ext.data.Node, Ext.util.Observable, {
+Ext.data.Node = Ext.extend(Ext.util.Observable, {
+
+ constructor: function(attributes){
+ /**
+ * The attributes supplied for the node. You can use this property to access any custom attributes you supplied.
+ * @type {Object}
+ */
+ this.attributes = attributes || {};
+ this.leaf = this.attributes.leaf;
+ /**
+ * The node id. @type String
+ */
+ this.id = this.attributes.id;
+ if(!this.id){
+ this.id = Ext.id(null, "xnode-");
+ this.attributes.id = this.id;
+ }
+ /**
+ * All child nodes of this node. @type Array
+ */
+ this.childNodes = [];
+ /**
+ * The parent node for this node. @type Node
+ */
+ this.parentNode = null;
+ /**
+ * The first direct child node of this node, or null if this node has no child nodes. @type Node
+ */
+ this.firstChild = null;
+ /**
+ * The last direct child node of this node, or null if this node has no child nodes. @type Node
+ */
+ this.lastChild = null;
+ /**
+ * The node immediately preceding this node in the tree, or null if there is no sibling node. @type Node
+ */
+ this.previousSibling = null;
+ /**
+ * The node immediately following this node in the tree, or null if there is no sibling node. @type Node
+ */
+ this.nextSibling = null;
+
+ this.addEvents({
+ /**
+ * @event append
+ * Fires when a new child node is appended
+ * @param {Tree} tree The owner tree
+ * @param {Node} this This node
+ * @param {Node} node The newly appended node
+ * @param {Number} index The index of the newly appended node
+ */
+ "append" : true,
+ /**
+ * @event remove
+ * Fires when a child node is removed
+ * @param {Tree} tree The owner tree
+ * @param {Node} this This node
+ * @param {Node} node The removed node
+ */
+ "remove" : true,
+ /**
+ * @event move
+ * Fires when this node is moved to a new location in the tree
+ * @param {Tree} tree The owner tree
+ * @param {Node} this This node
+ * @param {Node} oldParent The old parent of this node
+ * @param {Node} newParent The new parent of this node
+ * @param {Number} index The index it was moved to
+ */
+ "move" : true,
+ /**
+ * @event insert
+ * Fires when a new child node is inserted.
+ * @param {Tree} tree The owner tree
+ * @param {Node} this This node
+ * @param {Node} node The child node inserted
+ * @param {Node} refNode The child node the node was inserted before
+ */
+ "insert" : true,
+ /**
+ * @event beforeappend
+ * Fires before a new child is appended, return false to cancel the append.
+ * @param {Tree} tree The owner tree
+ * @param {Node} this This node
+ * @param {Node} node The child node to be appended
+ */
+ "beforeappend" : true,
+ /**
+ * @event beforeremove
+ * Fires before a child is removed, return false to cancel the remove.
+ * @param {Tree} tree The owner tree
+ * @param {Node} this This node
+ * @param {Node} node The child node to be removed
+ */
+ "beforeremove" : true,
+ /**
+ * @event beforemove
+ * Fires before this node is moved to a new location in the tree. Return false to cancel the move.
+ * @param {Tree} tree The owner tree
+ * @param {Node} this This node
+ * @param {Node} oldParent The parent of this node
+ * @param {Node} newParent The new parent this node is moving to
+ * @param {Number} index The index it is being moved to
+ */
+ "beforemove" : true,
+ /**
+ * @event beforeinsert
+ * Fires before a new child is inserted, return false to cancel the insert.
+ * @param {Tree} tree The owner tree
+ * @param {Node} this This node
+ * @param {Node} node The child node to be inserted
+ * @param {Node} refNode The child node the node is being inserted before
+ */
+ "beforeinsert" : true
+ });
+ this.listeners = this.attributes.listeners;
+ Ext.data.Node.superclass.constructor.call(this);
+ },
+