Page 2 of 2 FirstFirst 12
Results 11 to 14 of 14

Thread: Sencha Touch 2.1 marks Ajax JSON response as failed if server returns empty array

    You found a bug! We've classified it as TOUCH-3727 . We encourage you to continue the discussion and to find an acceptable workaround while we work on a permanent fix.
  1. #11
    Sencha User
    Join Date
    Jan 2013
    Posts
    13
    Vote Rating
    5
      0  

    Default

    We hit upon the same problem. Should be fixed in an upcoming version of Sencha Touch

  2. #12
    Sencha User
    Join Date
    Oct 2012
    Location
    Poland
    Posts
    70
    Vote Rating
    5
      0  

    Default

    I haven't updated my app yet, but looking at the source code it looks like this issue hasn't been fixed in 2.2.0.

    It's closed, so unless somebody reopens it again it will never get fixed.

  3. #13
    Sencha User
    Join Date
    Jun 2013
    Posts
    1
    Vote Rating
    0
      0  

    Default

    This bug also affects stores using memory proxies. Then you can just do:
    Code:
    store.setData([]);
    and immediately see it ignored, and the previous value retained. I'm still seeing this in sencha 2.2.1. I fixed it with an override of Ext.data.reader.Reader, but that's a pain to maintain.

    It's obvious that no data is a valid, non-error condition, and shouldn't be treated as an error.

  4. #14
    Sencha User
    Join Date
    Mar 2007
    Posts
    443
    Vote Rating
    18
      0  

    Default

    I'd like to second this bug. It's not just with Ajax proxies; it affects all proxies. Here's an example:

    Code:
    Ext.define('User', {
        extend: 'Ext.data.Model',
        config: {
            fields: [
                {name: 'id',    type: 'int'},
                {name: 'name',  type: 'string'},
                {name: 'phone', type: 'string', mapping: 'phoneNumber'}
            ]
        }
    });
    
    var store = Ext.create('Ext.data.Store', {
        model: 'User',
        data : [],
        proxy: {
            type: 'memory',
            reader: {
                type: 'json'
            }
        }
    });
    
    store.load({
    	callback: function(records, operation, success) {
    		console.log(success); // logs "false"
    	}
    });

Page 2 of 2 FirstFirst 12

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •