Results 1 to 2 of 2

Thread: Store not loading data, but page is fetched correctly

  1. #1
    Sencha User Fire-Dragon-DoL's Avatar
    Join Date
    Dec 2011
    Posts
    141
    Answers
    9

    Default Store not loading data, but page is fetched correctly

    I'm just going mad guys, I always used stores around my application but now I don't understand because one doesn't load data.

    I'm using the store for a combobox, but the problem is not connected to it because I'm trying to load the store through Firebug:
    Code:
    Ext.getStore('Cities').load()
    The operation is successful (tested with a callback), I can see in firebug that I get a response with a big json object.
    However, the data of the store is empty (0 items).

    Any suggestion on what the issue is? I'm posting here the store and the model (and a part of the big json object)

    Model
    Code:
    Ext.define('FedertrekDesktop.model.City', {
      extend: 'Ext.data.Model',
    
      proxy: {
        type: 'ajax',
        url: '/cities/index.extjson',
        reader: {
          type: 'json',
          root: 'root'
        }
      },
    
      fields: [
        {
          name: 'id',
          type: 'string'
        },
        {
          name: 'name',
          type: 'string'
        },
        {
          name: 'province',
          type: 'string'
        },
        {
          name: 'region',
          type: 'string'
        },
        {
          name: 'cap',
          type: 'string'
        }
      ],
    
      idProperty: 'id'
    
    });
    Store
    Code:
    Ext.define('FedertrekDesktop.store.Cities', {
      extend: 'Ext.data.Store',
      model: 'FedertrekDesktop.model.City',
    
      buffered: true,
      pageSize: 100,
    
      remoteSort: true,
      remoteFilter: true,
    
      autoSync: true
    });
    JSON
    Code:
    {"success":true,"total":8083,"message":"","root":[{"cap":12051,"created_at":"2011-11-23T18:26:32Z","id":101,"name":"Alba","province":"CN","region":"PIE","updated_at":"2011-11-23T18:26:32Z"},{"cap":64011,"created_at":"2011-11-23T18:26:32Z","id":102,"name":"Alba Adriatica","province":"TE","region":"ABR","updated_at":"2011-11-23T18:26:32Z"},...]}

  2. #2
    Sencha User Fire-Dragon-DoL's Avatar
    Join Date
    Dec 2011
    Posts
    141
    Answers
    9

    Default

    I just understood that the problem is the option buffered

    Why? How can I keep loading data when scrolling the combobox? The store is really big (8000+ elements) and I would like to do something similar like grid, when you scroll data is kept loading.

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
  •