Success! Looks like we've fixed this one. According to our records the fix was applied for TOUCH-1373 in a recent build.
  1. #1
    Sencha User
    Join Date
    Dec 2011
    Posts
    21
    Vote Rating
    1
    supersaiyen is on a distinguished road

      0  

    Default Ext.data.Connection fails when evaluating a file:// protocol's status

    Ext.data.Connection fails when evaluating a file:// protocol's status


    REQUIRED INFORMATIONExt version tested:
    • Sencha Touch 2 PR 3
    Browser versions tested against:
    • Safari
    • PhoneGap
    DOCTYPE tested against:
    • <!DOCTYPE html>
    Description:
    • With phone gap, anything in the www folder can be accessed with a relative url just as if it were being accessed from a web server: images, css, js, etc...
    • When loading data from a relative url, phonegap uses the file:// protocol.
    • When you specify some static data in a JSON/XML format in a data store using an AJAX proxy with a relative URL the application works fine when loaded from a server because of the use of the HTTP protocol, however with phonegap, or locally with the file:// protocol this fails and data is not loaded.
    Steps to reproduce the problem:
    • Create a simple DataStore with some JSON that fits the selected model.
    • Load that store.
    • "Compile" the program with the sencha tools
    • Run this using the file:// protocol as opposed to running off of a server. (use safari, as it allows cross domain req's with the file:// protocol)
    The result that was expected:
    • The store loads the data and data populates if injected into a view.
    The result that occurs instead:
    • No data is loaded, no error is thrown.
    Test Case:
    Code:
    Ext.Loader.setConfig({
        enabled : true
    });
    
    
    Ext.Loader.setPath('Ext', 'sencha/src');
    
    
    Ext.define('Contact', {
        extend : 'Ext.data.Model',
        fields : [ 'firstName', 'lastName' ]
    });
    
    
    var store = Ext.create('Ext.data.Store', {
        model : 'Contact',
        proxy:{
            type:'ajax',
            url: 'data/test.json',
            reader: {
                type: 'json',
                root: 'contacts'
            }
        }
    });
    
    
    var list = Ext
            .create(
                    'Ext.dataview.List',
                    {
                        title: 'Test',
                        itemTpl : '<div class="contact">{firstName} <strong>{lastName}</strong></div>',
                        store : store
                    });
    
    
    Ext.application({
    
    
        name : 'ConnectionTest',
    
    
        launch : function() {
            Ext.Viewport.add({
                xtype : 'navigationview',
                scrollable: true,
                items : [ list ]
            });
            store.load();
        }
    });
    Possible fix:
    • In Ext.data.Connection in the parseStatus method, before success is evaluated add the line
      • status = status == 0 ? 200 : status;
    • or change the success evaluation to
      • var success = (status >= 200 && status < 300) || status == 304 || status == 0,
    Additional CSS used:
    • only default ext-all.css
    Operating System:
    • OSX
    • iOS 5

  2. #2
    Sencha User Jamie Avins's Avatar
    Join Date
    Mar 2007
    Location
    Redwood City, California
    Posts
    3,661
    Vote Rating
    20
    Jamie Avins is a jewel in the rough Jamie Avins is a jewel in the rough Jamie Avins is a jewel in the rough

      0  

    Default


    Thank you for the report.

    Sencha Inc

    Jamie Avins

    @jamieavins

  3. #3
    Sencha User
    Join Date
    Mar 2007
    Location
    Haarlem, Netherlands
    Posts
    1,243
    Vote Rating
    10
    TommyMaintz will become famous soon enough TommyMaintz will become famous soon enough

      0  

    Default


    I added the || status == 0 to the success check. Is this all that is needed to get this to work or do we need to do something else to support this?

  4. #4
    Sencha User
    Join Date
    Dec 2011
    Posts
    21
    Vote Rating
    1
    supersaiyen is on a distinguished road

      0  

    Default


    The
    || status == 0 is all thats needed, this is great, thanks.

Thread Participants: 2

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