1. #1
    Sencha User
    Join Date
    Apr 2011
    Posts
    212
    Vote Rating
    3
    bweiler is on a distinguished road

      0  

    Default Ext.data.proxy.Memory Errors

    Ext.data.proxy.Memory Errors


    I really like 2.0 so far, but I'm stuck getting a simple list to work. The following code is taken directly from the List code in the 2.0 Kitchen Sink example with a few minor tweeks to get it working independently.

    Here's the error I'm getting:

    TypeError: 'undefined' is not a valid argument for 'instanceof' (evaluating 'proxy instanceof Ext.data.proxy.Memory')

    It seems to be a problem with the static data in the store. Any help will be appreciated.

    Thanks


    Code:
    Ext.application({
        name: 'Test'
    });
    
    
    // Changed Ext.regModel to Ext.define
    Ext.define('Contact', {
        extend: 'Ext.data.Model',
        fields: ['firstName', 'lastName']
    });
    
    
    Ext.create('Ext.data.Store', {
        id: 'ListStore',
        model: 'Contact',
        sorters: 'firstName',
        getGroupString : function(record) {
            return record.get('firstName')[0];
        },
        data: [
            {firstName: 'Julio', lastName: 'Benesh'},
            {firstName: 'Julio', lastName: 'Minich'},
            {firstName: 'Tania', lastName: 'Ricco'},
            {firstName: 'Odessa', lastName: 'Steuck'},
            {firstName: 'Nelson', lastName: 'Raber'},
            {firstName: 'Tyrone', lastName: 'Scannell'},
            {firstName: 'Allan', lastName: 'Disbrow'},
            {firstName: 'Cody', lastName: 'Herrell'},
            {firstName: 'Julio', lastName: 'Burgoyne'},
            {firstName: 'Jessie', lastName: 'Boedeker'},
            {firstName: 'Allan', lastName: 'Leyendecker'},
            {firstName: 'Javier', lastName: 'Lockley'},
            {firstName: 'Guy', lastName: 'Reasor'},
            {firstName: 'Jamie', lastName: 'Brummer'},
            {firstName: 'Jessie', lastName: 'Casa'},
            {firstName: 'Marcie', lastName: 'Ricca'},
            {firstName: 'Gay', lastName: 'Lamoureaux'},
            {firstName: 'Althea', lastName: 'Sturtz'},
            {firstName: 'Kenya', lastName: 'Morocco'},
            {firstName: 'Rae', lastName: 'Pasquariello'},
            {firstName: 'Ted', lastName: 'Abundis'},
            {firstName: 'Jessie', lastName: 'Schacherer'},
            {firstName: 'Jamie', lastName: 'Gleaves'},
            {firstName: 'Hillary', lastName: 'Spiva'},
            {firstName: 'Elinor', lastName: 'Rockefeller'},
            {firstName: 'Dona', lastName: 'Clauss'},
            {firstName: 'Ashlee', lastName: 'Kennerly'},
            {firstName: 'Alana', lastName: 'Wiersma'},
            {firstName: 'Kelly', lastName: 'Holdman'},
            {firstName: 'Mathew', lastName: 'Lofthouse'},
            {firstName: 'Dona', lastName: 'Tatman'},
            {firstName: 'Clayton', lastName: 'Clear'},
            {firstName: 'Rosalinda', lastName: 'Urman'},
            {firstName: 'Cody', lastName: 'Sayler'},
            {firstName: 'Odessa', lastName: 'Averitt'},
            {firstName: 'Ted', lastName: 'Poage'},
            {firstName: 'Penelope', lastName: 'Gayer'},
            {firstName: 'Katy', lastName: 'Bluford'},
            {firstName: 'Kelly', lastName: 'Mchargue'},
            {firstName: 'Kathrine', lastName: 'Gustavson'},
            {firstName: 'Kelly', lastName: 'Hartson'},
            {firstName: 'Carlene', lastName: 'Summitt'},
            {firstName: 'Kathrine', lastName: 'Vrabel'},
            {firstName: 'Roxie', lastName: 'Mcconn'},
            {firstName: 'Margery', lastName: 'Pullman'},
            {firstName: 'Avis', lastName: 'Bueche'},
            {firstName: 'Esmeralda', lastName: 'Katzer'},
            {firstName: 'Tania', lastName: 'Belmonte'},
            {firstName: 'Malinda', lastName: 'Kwak'},
            {firstName: 'Tanisha', lastName: 'Jobin'},
            {firstName: 'Kelly', lastName: 'Dziedzic'},
            {firstName: 'Darren', lastName: 'Devalle'},
            {firstName: 'Julio', lastName: 'Buchannon'},
            {firstName: 'Darren', lastName: 'Schreier'},
            {firstName: 'Jamie', lastName: 'Pollman'},
            {firstName: 'Karina', lastName: 'Pompey'},
            {firstName: 'Hugh', lastName: 'Snover'},
            {firstName: 'Zebra', lastName: 'Evilias'}
        ]
    });
    
    
    Ext.define('Kitchensink.view.List', {
        extend: 'Ext.tab.Panel',
        config: {
            activeItem: 2,
            tabBar: {
                docked: 'top',
                layout: {
                    pack: 'center'
                }
            },
            items: [{
                title: 'Simple',
                layout: Ext.os.deviceType == 'Phone' ? 'fit' : {
                    type: 'vbox',
                    align: 'center',
                    pack: 'center'
                },
                cls: 'demo-list',
                items: [{
                    width: Ext.os.deviceType == 'Phone' ? null : 300,
                    height: Ext.os.deviceType == 'Phone' ? null : 500,
                    xtype: 'list',
                    store: 'ListStore',
                    itemTpl: '<div class="contact"><strong>{firstName}</strong> {lastName}</div>'
                }]
            }, {
                title: 'Grouped',
                layout: Ext.os.deviceType == 'Phone' ? 'fit' : {
                    type: 'vbox',
                    align: 'center',
                    pack: 'center'
                },
                cls: 'demo-list',
                items: [{
                    width: Ext.os.deviceType == 'Phone' ? null : 300,
                    height: Ext.os.deviceType == 'Phone' ? null : 500,
                    xtype: 'list',
                    store: 'ListStore',
                    itemTpl: '<div class="contact"><strong>{firstName}</strong> {lastName}</div>',
                    grouped: true,
                    indexBar: true
                }]
            }, {
                title: 'Disclosure',
                layout: Ext.os.deviceType == 'Phone' ? 'fit' : {
                    type: 'vbox',
                    align: 'center',
                    pack: 'center'
                },
                cls: 'demo-list',
                items: [{
                    width: Ext.os.deviceType == 'Phone' ? null : 300,
                    height: Ext.os.deviceType == 'Phone' ? null : 500,
                    xtype: 'list',
                    onItemDisclosure: function(record, btn, index) {
                        Ext.Msg.alert('Tap', 'Disclose more info for ' + record.get('firstName'), Ext.emptyFn);
                    },
                    store: 'ListStore', //getRange(0, 9),
                    itemTpl: '<div class="contact"><strong>{firstName}</strong> {lastName}</div>'
                }]
            }]
        }
    });
    
    
    // Added call to show the list.
    Ext.create('Kitchensink.view.List').show();

  2. #2
    Sencha - Sencha Touch Dev Team rdougan's Avatar
    Join Date
    Oct 2008
    Posts
    1,158
    Vote Rating
    6
    rdougan will become famous soon enough

      0  

    Default


    Which ST file are you using from the SDK? sencha-touch.js? Try using the sencha-touch-all-debug.js file from the SDK instead.
    Sencha Inc.
    Robert Dougan - @rdougan
    Sencha Touch 2 and Ext JS 4 Core Team Member, SASS/Theming Wizard.

  3. #3
    Sencha User
    Join Date
    Apr 2011
    Posts
    212
    Vote Rating
    3
    bweiler is on a distinguished road

      0  

    Default Workaround

    Workaround


    I'm using sencha-touch-debug.js, so I'll try sencha-touch-all-debug.js and see if it helps with debugging. However, this looks like a bug to me. With 1.x I didn't need to explicitly create a proxy to read inline data.

    Here's the workaround I'm using for now:

    Code:
    Ext.create('Ext.data.Store', {
        id: 'ListStore',
        model: 'Contact',
        sorters: 'firstName',
        getGroupString : function(record) {
            return record.get('firstName')[0];
        },
    
    
        data: [
            {firstName: 'Julio', lastName: 'Benesh'},
            {firstName: 'Julio', lastName: 'Minich'},
            {firstName: 'Tania', lastName: 'Ricco'},
            {firstName: 'Odessa', lastName: 'Steuck'},
            ...
        ],
    
    
        // 2.0 Workaround to load data
        proxy: {
    	    type: 'memory',
    	    reader: {
    	        type: 'json',
    	        root: this.data
    	    }
    	}
    });

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