renderingContent:function(widget){
uilayer.confirm("", this.renderingContextWidgetOnOkClick,this.contextChangeCancelHandler);
}
renderingContextWidgetOnOkClick:function(widget){
console.log(widget);
}
如何将我在renderContent函数中获得的widget参数传递给回调this.renderingContextWidgetOnOkClick,点击OK后调用它,因为我无法调用this.renderingContextWidgetOnOkClick(widget),因为这个函数直接被调用而没有单击? / p>
答案 0 :(得分:3)
您可以将其包装在函数中
renderingContent:function(widget){
uilayer.confirm("",
(function(that, widget){
return function(){
that.renderingContextWidgetOnOkClick(widget);
};
})(this, widget),this.contextChangeCancelHandler);
}