Wait! Looks like we don't have enough information to add this to bug database. Please follow this template bug format.
  1. #1
    Sencha User
    Join Date
    May 2013
    Posts
    55
    Vote Rating
    1
    guillaumeCharron is on a distinguished road

      0  

    Default Local Storage modify object structure?

    Local Storage modify object structure?


    Let's say we have the following structure :


    model_Projects owns an array of model_Category.
    Each model_Category owns an array of model_SubCategory.


    I actually have a store of model_Projects which has a localStorage Proxy.


    What happens is, when I load sync() and load() my store of model_Projects, in each model_Projects my array of model_Category is the good size and each cell do contain an object.


    What is wrong is that each of those objects are not model_Category object...


    Here is my console.log() function of a project
    HTML Code:
        console.log('\n' + this.get('strTitle') + ' - ' + this.get('strType'));
        console.log(this.get('strVersion'));
        console.log('Event will be on : ' + this.get('dateOfProject') + '\n');
        
        
        var arrCategory = this.get('arrCategory');
        var arrSub;
        var arrType;
        
        for(i in arrCategory)
        {
            console.log(arrCategory[i].get('strTitle') + '   Total : ' + arrCategory[i].get('numTotal') + '\n');
        
            //Each Sub Category
            arrSub = arrCategory[i].get('arrSubCategory');
            for(j in arrSub)
            {
        
                if(arrCategory[i].get('arrSubTotal') === undefined)
                console.log('\t' + arrSub[j].get('strTitle'));
                else
                console.log('\t' + arrSub[j].get('strTitle') + '\t SubTotal : ' + arrCategory[i].get('arrSubTotal')[j]);
        
                arrType = arrSub[j].get('arrType');
                arrValue = arrSub[j].get('arrValue');
                arrCOFactor = arrSub[j].get('arrCOFactor');
                for( var k=0; k<arrType.length; k++)
                {
                    if(arrValue === undefined)
                    console.log('\t\t' + arrType[k] + '\t\t Value : ' + 'NA' + '\t\t COFactor : ' + arrCOFactor[k]);
                    else
                    console.log('\t\t' + arrType[k] + '\t\t Value : ' + arrValue[k] + '\t\t COFactor : ' + arrCOFactor[k]);
        
                }
                console.log('');
            } 
        }
        
        console.log('\n'+this.get('strTitle') + ' - ' + this.get('strType') + '\n');

    Here is a project.show() right after being created, read from the project store.

    Capture d’écran 2013-06-12 à 16.04.36.png



    And here is what I get when i project.show() after loading the project store

    Capture d’écran 2013-06-12 à 16.04.58.png


    If we open the error we get the following line crashing :


    HTML Code:
    console.log(arrCategory[i].get('strTitle') + '   Total : ' + arrCategory[i].get('numTotal') + '\n');

    seems like arrCategory[i] is not a category model anymore... Doesn't look normal to me that my objects are not what they were anymore. Plus if I do a console.log() of a project (after store.load()), I can find all the data has it's supposed to be, but the tree-structure of the data and methods and everything does not seem to be the same...


    Would someone know what is going on?

  2. #2
    Sencha - Senior Forum Manager mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    36,801
    Vote Rating
    834
    mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute

      0  

    Default


    can I get a fully locally runnable test?
    Mitchell Simoens @SenchaMitch
    Sencha Inc, Senior Forum Manager
    ________________
    Check out my GitHub, lots of nice things for Ext JS 4 and Sencha Touch 2
    https://github.com/mitchellsimoens

    Think my support is good? Get more personalized support via a support subscription. https://www.sencha.com/store/

    Need more help with your app? Hire Sencha Services services@sencha.com

    Want to learn Sencha Touch 2? Check out Sencha Touch in Action that is in print!

    When posting code, please use BBCode's CODE tags.

  3. #3
    Sencha User
    Join Date
    May 2013
    Posts
    55
    Vote Rating
    1
    guillaumeCharron is on a distinguished road

      0  

    Default


    Someone found the problem... Local Storage just crashes the methods/function of my object with the string serialisation to JSON.

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