我有以下代码:

targetMu: function(programmeCode, muId) {

//Parameter values are fine here

  targetMuController.targetMuView.on("targetMu:afterRender", function(programmeCode, muId) {
        this.renderCustomWidgets(muId, programmeCode);
  });
}


this.renderCustomWidgets(muId, programmeCode)被解雇时,programmeCodemuId未定义,为什么?

我该如何解决呢?

最佳答案

尝试从匿名函数中删除参数:

targetMu: function(programmeCode, muId) {
    targetMuController.targetMuView.on("targetMu:afterRender", function() {
        this.renderCustomWidgets(muId, programmeCode);
    });
}

07-28 06:15