Results 1 to 4 of 4

Thread: List.View inside Ext.Panel (even with container's layout defined)

  1. #1

    Default List.View inside Ext.Panel (even with container's layout defined)

    Hi guys,

    I already read almost all topics about this issue here, but I believe that my problem is different than these topics, which I read. So, I'm trying to put one Ext.dataview.List into a Ext.Panel, but the list doesn't show on Panel, I already set (layout: 'fit') on panel's config, I already set manually list's height, but nothing is working. In the console I can see the list, the store and record inside store. When I trying see the list outside the panel everything works, only inside the panel it doesn't. bellow there is my code:


    My Model:

    Code:
    Ext.define('MyApp.model.PrestadorModel',{    extend: 'Ext.data.Model',
        config: {
            fields: [{
                name: 'nome'
            },{
                name: 'id_medico'
            },{
                name: 'especialidade'
            },{
                name: 'id_credenc'
            },{
                name: 'plano'
            },{
                name: 'endereco'
            },{
                name: 'bairro'
            },{
                name: 'fone'
            },{
                name: 'cidade'
            }]
        }
    });
    My Store:

    Code:
    Ext.define('MyApp.store.PrestadoresStore',{    extend: 'Ext.data.Store',
        requires: [
            'Ext.data.proxy.JsonP',
            'MyApp.model.PrestadorModel'
        ],
        config:{
            model: 'MyApp.model.PrestadorModel',
            storeId: 'prestadores',
            proxy: {
                type: 'jsonp',
                url: 'http://empresa.gruposaojosesaude.com.br/teste/guiaMedicoMobControl.php?action=getPrestador',
                reader: {
                    type: 'json',
                    rootProperty: 'prestador'
                }
            }
        }
    });
    My Panel:

    Code:
    Ext.define('MyApp.view.Prestadores',{    extend: 'Ext.Panel',
        alias: 'widget.viewprestadores',
        requires: [ 
            'Ext.List',
            'MyApp.store.PrestadoresStore'
        ],        
        config: {
            //Dados sero preenchidos quando esta view for chamada
            codCidade: null, 
            codPlano: null, 
            codEspec: null,
    
    
            fullscreen: true,
            layout: {
                type: 'fit'
            },    
            items: [{
                    xtype: 'titlebar',
                    title: 'Encontrados',
                    docked: 'top',
                    items: [{
                        xtype: 'button',
                        text: 'Voltar',
                        ui: 'back',
                        itemId: 'btVoltar',
                        align: 'left'
                    }]
                
            },{    
                flex: 1,
                xytpe: 'list',
                height: 300,
                emptyText: 'Nenhum Prestador Encontrado Para os Dados Selecionados',
                itemId: 'listprestadores',
                   store: Ext.create('MyApp.store.PrestadoresStore'),
                itemTpl: '{nome}'
            }]
        }
    });
    My Controller that load the store:

    Code:
    Ext.define('MyApp.controller.Prestadores',{    extend: 'Ext.app.Controller',
        config:{
            refs:{
                refBtVoltar: 'button#btVoltar',
                refMain: 'main',
                refViewPrestadores: 'viewprestadores'
            },
    
    
            control:{
                refBtVoltar: {
                    tap: 'onTapBtVoltar'
                },
    
    
                refViewPrestadores: {
                    show: 'onShowView'
                }
            }
        },
    
    
        onShowView: function(){
            Ext.getStore('prestadores').setParams({
                id_cidade: this.getRefViewPrestadores().getCodCidade(),
                id_plano: this.getRefViewPrestadores().getCodPlano(),
                id_espec: this.getRefViewPrestadores().getCodEspec()
            }).load();
    
    
            console.log(this.getRefViewPrestadores().down('#listprestadores'));
        },
    
    
        onTapBtVoltar: function(){
            var main = this.getRefMain();
    
    
            Ext.Viewport.animateActiveItem(main, {type: 'slide', direction: 'right'});
        }
    });
    Can someone help me?

    Thanks for now!

    Josemar

  2. #2
    Sencha Premium User
    Join Date
    May 2011
    Location
    Gainesville, FL
    Posts
    227

    Default

    There's a typo in your list config ("xytpe")

  3. #3

    Default

    Man, that's so embarrassing, I mean, how much I was stupid lol. What you told is true, I fixed it and everything worked now! Thank you so much!

  4. #4
    Sencha Premium User
    Join Date
    May 2011
    Location
    Gainesville, FL
    Posts
    227

    Default

    we've all been there :-)

Posting Permissions

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