PDA

View Full Version : [FIXED-1019] TreeNode created pokes a new indexOf function into its childNodes Array



Animal
2 Jun 2010, 5:17 AM
src/data/Tree.js has



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;
};
}


That's not necessary Array.indexOf is part of Ext Core.

Jamie Avins
2 Jun 2010, 8:13 AM
A remnant from the past, slate it for 3.3.x

evant
8 Jun 2010, 1:47 AM
This will be available in 3.3.0