Results 1 to 2 of 2

Thread: store do not load list using proxy type ajax

  1. #1
    Sencha User
    Join Date
    Jan 2018
    Posts
    10

    Default store do not load list using proxy type ajax

    Hello, this is my problem, I have an store using proxy type ajax

    Ext.define('app.store.PersonaStore', {
    extend: 'Ext.data.Store',
    alias: 'store.PersonaStore',
    requires: [
    'app.model.Persona'
    ],
    model: 'app.model.Persona',
    autoload:true,
    fields: ['id','name','email','phone'],
    proxy: {
    type: 'ajax',
    url: 'server/persona_list.php',
    reader: {
    type: 'json',
    rootProperty: 'data',
    totalProperty: 'total'
    }
    }

    });


    my grid do not show the results:

    Ext.define('app.view.main.List', {
    extend: 'Ext.grid.Panel',
    xtype: 'mainlist',
    requires: [
    'app.view.list.PersonaModel',
    'app.store.PersonaStore'
    ],
    viewModel: {
    type: 'PersonaModel'
    },
    bind: {
    store: '{personas}',
    title: '{title}'
    },
    title: 'Persona',
    columns: [
    { text: 'Name', dataIndex: 'name' },
    { text: 'Email', dataIndex: 'email', flex: 1 },
    { text: 'Phone', dataIndex: 'phone', flex: 1 }
    ],

    });

    This is my ViewModel:

    Ext.define('app.view.list.PersonaModel', {
    extend: 'Ext.app.ViewModel',
    alias: 'viewmodel.PersonaModel',

    data: {
    title: 'Listado de personas'
    },

    stores: {
    personas:{
    type: 'PersonaStore'
    }
    }
    });

    And my model:

    Ext.define('app.model.Persona', {
    extend: 'Ext.data.Model',
    requires:[
    'Ext.data.proxy.Ajax'
    ],
    idProperty : 'id',
    fields: [
    {name: 'id', type: 'integer'},
    {name: 'name', type: 'string'},
    {name: 'email', type: 'string'},
    {name: 'phone', type: 'string'}
    ]
    });

    What can be the problem? Thanks in advance

  2. #2
    Sencha Premium User
    Join Date
    Mar 2017
    Posts
    21

    Default

    Just try :
    Code:
    autoLoad:true,
    instead of
    Code:
    autoload:true,

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
  •