reactjs - Jquery each loop $this pointer scope -


in jquery i'm stuck understanding this scope inside each loop. i'm not able access other function accessing inside each loop.

i'm getting error:

self.loadgraphchart not function" , "cannot read property 'location' of undefined

please let me know how can access other functions inside each loop.

    loadgraphonscroll() {                var self = this;        $(".scrollposition").each(function() {         var cluster = self.props.location.query.id;         self.loadgraphchart('p1','p2');       }     });   }    loadgraphchart('p1','p2') { } 

edit

actual code comments:

loadgraphonscroll() {    $(".scrollposition").each(function() {      var visible = $(this).visible('partial');      if(visible == true) {        var getid = $(this).attr('id');        var id = this.props.location.query.id;        var graphtype = jsondata.plots[getid].graphtype;       this.loadgraphchart(id, graphtype);      }    });  }      


Comments

Popular posts from this blog

Command prompt result in label. Python 2.7 -

javascript - How do I use URL parameters to change link href on page? -

amazon web services - AWS Route53 Trying To Get Site To Resolve To www -