TreePanelState.prototype.init = function()
{
this.cp = new Ext.state.CookieProvider();
this.state = this.cp.get(this.cookiePrefix + this.mytree.id, new Array() );
}不理解TreePanelState.prototype.init = function() 这里
{
this.cp = new Ext.state.CookieProvider();
this.state = this.cp.get(this.cookiePrefix + this.mytree.id, new Array() );
}不理解TreePanelState.prototype.init = function() 这里
tps.init();
tps1.init();
var tps2=new TreePanelState();
tps2.init();
....
多少个实例都可以共有这个init方法!而且不重复实例该init,效率上比this的要高,这就是prototype的魅力!