嗨,我收到了錯誤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"));
}));
});
},