1. #1
    Sencha User zeneto's Avatar
    Join Date
    Nov 2010
    Location
    Recife - PE, Brazil
    Posts
    2
    Vote Rating
    0
    zeneto is on a distinguished road

      0  

    Default Erro(c.store is undefined) when load: combobox

    Erro(c.store is undefined) when load: combobox


    I have a problem like you help.
    I have the following codes:

    Model:
    Code:
    Ext.define('EstudoExt.model.Estado',{
        extend: 'Ext.data.Model',
        idProperty: 'modelEstado',
        fields: [
        {
            name: 'id_estado', 
            type: 'int'
        },
        {
            name: 'nome', 
            type: 'string'
        }
        ]   
    });
    Store:
    Code:
    Ext.define('EstudoExt.store.Estados',{
        extend: 'Ext.data.Store',
        model: 'EstudoExt.model.Estado',
        storeId : 'Estados',
        autoLoad: true,
        proxy: {
            type: 'ajax',
            url: 'data/estados.json',
            reader: {
                root: 'data',
                type: 'json',
                successProperty: 'success'
            }
        }
    });
    Combo:
    Code:
    Ext.define('EstudoExt.view.pessoaJuridica.ComboEstado', {
        extend: 'Ext.form.field.ComboBox',
        alias: 'widget.estadoCombo',
        name : 'id_estado',
        ref: 'id_estado',
        fieldLabel: 'Estados',
        store: 'Estados',
        displayField: 'nome',
        valueField: 'id_estado',
        queryMode: 'local',
        typeAhead: true,
        forceSelection: true,
        initComponent: function() {
            this.callParent(arguments);
        }
    });
    Code:
    Ext.require('EstudoExt.view.pessoaJuridica.ComboEstado');
    
    Ext.define('EstudoExt.view.pessoaJuridica.Edit', {
        extend: 'Ext.window.Window',
        alias : 'widget.pessoaJuridicaEdit',
        title : 'Edição de Pessoa Juridica',
        layout: 'fit',
        autoShow: true,
        modal: true,
        width: 300,
        height: 450,
        initComponent: function() {
            this.items = [{
                    xtype:'tabpanel',
                    activeTab: 0,
                    defaults:{
                        bodyStyle:'padding:10px'
                    },
                    items:[{
                            title:'Dados da Empresa',
                            defaultType: 'textfield',
                            items: [{
                                    xtype: 'estadoCombo'
                                },{
                                    fieldLabel: 'Nome Fantasia',
                                    name: 'nome_fantasia',
                                    allowBlank: false
                                },{...



    when the view loads I get the error: c.store is undefined (ext-all.js - line 15)
    I don't know what happened!

  2. #2
    Sencha - Senior Forum Manager mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    37,652
    Vote Rating
    901
    mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute

      0  

    Default


    First you should be using ext-debug.js during development which will tell you more information and dynamically load Ext JS classes. Did you create an instance of the store?
    Mitchell Simoens @SenchaMitch
    Sencha Inc, Senior Forum Manager
    ________________
    Check out my GitHub, lots of nice things for Ext JS 4 and Sencha Touch 2
    https://github.com/mitchellsimoens

    Think my support is good? Get more personalized support via a support subscription. https://www.sencha.com/store/

    Need more help with your app? Hire Sencha Services services@sencha.com

    Want to learn Sencha Touch 2? Check out Sencha Touch in Action that is in print!

    When posting code, please use BBCode's CODE tags.

  3. #3
    Sencha User zeneto's Avatar
    Join Date
    Nov 2010
    Location
    Recife - PE, Brazil
    Posts
    2
    Vote Rating
    0
    zeneto is on a distinguished road

      0  

    Default


    The problem was exactly that! I had called the Store on my controller.

    Thank you!!!

Thread Participants: 1