1. #1
    Sencha Premium Member
    Join Date
    May 2013
    Location
    Stevenage, United Kingdom
    Posts
    44
    Vote Rating
    0
    uzair.sheikh is on a distinguished road

      0  

    Red face button tap resets to first index of array everytime tap

    button tap resets to first index of array everytime tap


    I am trying to build logic but can't really workout.

    - I have two button, forward and backward.
    - An array which contains Key values from the LocalStorage (e.g an array with 4 indexes contains keys from localstorage)
    - First time my form loads, I get first index of array and show the related data from localstorage into the form filelds (all fine here
    - When I click next button, I increase the array index by 1 to get next records from LocalStorage (all fine here
    - (This is where problem is ) But when I click next button again, ofcourse it calls the button tap again and runs my for loop (inside the button tap event function) from start and gets me the index at 1 again.

    Any suggestions please?
    Thanks in advance.

  2. #2
    Sencha Premium Member
    Join Date
    May 2013
    Location
    Stevenage, United Kingdom
    Posts
    44
    Vote Rating
    0
    uzair.sheikh is on a distinguished road

      0  

    Default Any Idea?

    Any Idea?


    Any idea guys?

    Is it possible to define a variable globally and so that it should be accessible in my button tap events and should not be reset every-time I tap button?

  3. #3
    Sencha - Architect Dev Team aconran's Avatar
    Join Date
    Mar 2007
    Posts
    9,176
    Vote Rating
    119
    aconran is a splendid one to behold aconran is a splendid one to behold aconran is a splendid one to behold aconran is a splendid one to behold aconran is a splendid one to behold aconran is a splendid one to behold aconran is a splendid one to behold

      0  

    Default


    Someone would need some code to point you in the right direction.

    I suspect that you have formed a bad closure or you're holding onto a reference or you have a global variable... Hard to guess without seeing the code.
    Aaron Conran
    @aconran
    Sencha Architect Development Team

Thread Participants: 1

Turkiyenin en sevilen filmlerinin yer aldigi xnxx internet sitemiz olan ve porn sex tarzi bir site olan mobil porno izle sitemiz gercekten dillere destan bir durumda herkesin sevdigi bir site olarak tarihe gececege benziyor. Sitenin en belirgin ozelliklerinden birisi de Turkiyede gercekten kaliteli ve muntazam, duzenli porno izle siteleri olmamasidir. Bu yuzden iste. Ayrica en net goruntu kalitesine sahip adresinde yayinlanmaktadir. Mesela diğer sitelerimizden bahsedecek olursak, en iyi hd porno video arşivine sahip bir siteyiz. "The Best anal porn videos and slut anus, big asses movies set..." hd porno faketaxi