1. #1
    Ext User
    Join Date
    Feb 2008
    Posts
    275
    Vote Rating
    0
    Rafael is on a distinguished road

      0  

    Default Error: combo is undefined

    Error: combo is undefined


    Code:
        var TipoCliente = [
             ['fisica', 'Pessoa Física']
            ,['juridica', 'Pessoa Jurídica']
        ];
    Code:
                              xtype: 'combo'
                                ,hiddenName:'codigo_tipo_funcionario'
                                ,id: 'tipo_cliente'
                                ,name: 'tipo_cliente'
                                ,width: 145
                                ,fieldLabel:'Tipo Cliente'
                                ,displayField: 'nome'
                                ,valueField: 'id'
                                ,editable: false
                                ,store: new Ext.data.SimpleStore({
                                     fields:['id', 'nome']
                                    ,data: TipoCliente
                                    ,listeners:{
                                        'load': function(){
                                            var combo = Ext.getCmp('tipo_cliente');
                                            combo.setValue('fisica');
                                        },
                                    }
                                    ,autoLoad : true
                                })

  2. #2
    jay@moduscreate.com's Avatar
    Join Date
    Mar 2007
    Location
    Frederick MD, NYC, DC
    Posts
    16,361
    Vote Rating
    81
    jay@moduscreate.com is a name known to all jay@moduscreate.com is a name known to all jay@moduscreate.com is a name known to all jay@moduscreate.com is a name known to all jay@moduscreate.com is a name known to all jay@moduscreate.com is a name known to all

      0  

    Default


    why not:
    Code:
     xtype: 'combo'
                                ,hiddenName:'codigo_tipo_funcionario'
                                ,id: 'tipo_cliente'
                                ,name: 'tipo_cliente'
                                ,width: 145
                                ,value : 'fisica'
                                ,fieldLabel:'Tipo Cliente'
                                ,displayField: 'nome'
                                ,valueField: 'id'
                                ,editable: false
                               , mode : 'local'
                                ,store: new Ext.data.SimpleStore({
                                     fields:['id', 'nome']
                                    ,data: TipoCliente
                                    ,autoLoad : true
                                })

Thread Participants: 1