0

Could anyone help? when the UpdateDataSuccessCallback run , the 'this.localData' is always undefined, I think I didn't get the this.localData of RebateDataClass, however how I can get it within UpdateDataSuccessCallback ? Thanks very much

function RebateDataClass(d) {

    this.localData;
    var getdate = d;
    this.Init = function init() {
      getdata('get', "../tools/AgentRebateReportHandler.ashx?action=GetIndexData&dateType=" + getdate + "&r=" + Math.random, '', 'json', InitDataSuccessCallback, true);
    }

    function InitDataSuccessCallback(e) {
      this.localData = e.data;
      IndexPage.InitPage(getdate, e.data);
    }

    this.UpdateDataByDate = function UpdateData() {
      getdata('get', "../tools/AgentRebateReportHandler.ashx?action=GetIndexData&dateType=" + getdate + "&r=" + Math.random, '', 'json', UpdateDataSuccessCallback, true);
    }

    function UpdateDataSuccessCallback(e) {
      if (e.state == "ok") {
        IndexPage.UpdatePage(getdate, this.localData, e.data);
        //the this.localData is undefined
        this.localData = e.data;
      } else {

      }
    }
Barmar
  • 741,623
  • 53
  • 500
  • 612
Jswq
  • 758
  • 1
  • 7
  • 23

0 Answers0