嗨,我收到了错误this._radioButtons未定义(**之间的代码)在下面的代码片段。有什么关于我在这里失踪的关闭?this.variable is undefined
_adjustChoices: function(choices) {
// TODO Tear down all the old radion buttons and their change handlers.
debugger;
this._radioButtons = [];
this._changeHandlers = [];
array.forEach(choices, function(choice) {
var radioButton = new RadioButton(lang.mixin({
name: this._clusterName
}, choice));
**this._radioButtons.push(radioButton);**
this._changeHandlers.push(connect.connect, radioButton, "onChange", lang.hitch(this, function(value) {
// TODO Figure out which radio button is selected and get its value.
//var radioButton = ????;
this.set("value", radioButton.get("checked"));
}));
});
},