这段js代码怎么回事?高手帮我看下

问题是这样的,下面的代码我在"红1"处alert是可以弹出预想的内容,可是,在"红2"处却跟我说undefined,有人知道为什么吗?
详细情形: 页面初始化的时候会执行enableItemEditor 方法,这时会弹出红1,可是,当点击节点(触发setOnClickHandler方法)时,却提示undefined。
[code="java"]
dhtmlXTreeObject.prototype.enableItemEditor = function (mode) {
this._eItEd = convertStringToBoolean(mode);
alert(this._stopEditItem);// 红1

if (!this._eItEdFlag) {
this._edn_click_IE = true;
this._edn_dblclick = true;
this._ie_aFunc = this.aFunc;
this._ie_dblclickFuncHandler = this.dblclickFuncHandler;
this.setOnDblClickHandler(function (a, b) {
if (this._edn_dblclick) {
this._editItem(a, b);
}
return true;
});
this.setOnClickHandler(function (a, b) {
alert(this._stopEditItem);//红2
this._stopEditItem(a, b);
if ((this.ed_hist_clcik == a) && (this._edn_click_IE)) {
this._editItem(a, b);
}
this.ed_hist_clcik = a;
return true;
});
this._eItEdFlag = true;
}
};
dhtmlXTreeObject.prototype._stopEditItem = function (id, tree) {
alert(id);
this._stopEdit(id);
};
[/code]

应该修改成这样

[code="java"]
dhtmlXTreeObject.prototype.enableItemEditor = function (mode) {
this._eItEd = convertStringToBoolean(mode);
alert(this._stopEditItem);// 红1

if (!this._eItEdFlag) {
this._edn_click_IE = true;
this._edn_dblclick = true;
this._ie_aFunc = this.aFunc;
this._ie_dblclickFuncHandler = this.dblclickFuncHandler;
this.setOnDblClickHandler(function (a, b) {
if (this._edn_dblclick) {
this._editItem(a, b);
}
return true;
});
//用闭包来解决this的问题
var that = this;
this.setOnClickHandler(function (a, b) {
alert(that._stopEditItem);//红2
that._stopEditItem(a, b);
if ((that.ed_hist_clcik == a) && (that._edn_click_IE)) {
that._editItem(a, b);
}
that.ed_hist_clcik = a;
return true;
});
that._eItEdFlag = true;
}
};
dhtmlXTreeObject.prototype._stopEditItem = function (id, tree) {
alert(id);
this._stopEdit(id);
};
[/code]