1. #1
    Sencha User
    Join Date
    Nov 2010
    Posts
    5
    Vote Rating
    0
    anurag_bhd is on a distinguished road

      0  

    Default Unanswered: Adding a list to a panel not working

    Unanswered: Adding a list to a panel not working


    In my code, I'm creating an object for a list and a separate object for a panel. When I add the list to the panel using the 'add' method, just the panel gets rendered and the list becomes invisible. And if I comment the code
    Code:
    mainPanel.add(mainList);
    just the list gets rendered and the panel becomes invisible. Same results if I add the list to the 'items' config option of the panel. Am I doing it wrongly than what's given in the official documentation here - http://docs.sencha.com/touch/2-0/#!/...ents-section-6?

    Tested in Chrome 16 and Safari 5.0.3

    Code:
    Ext.application({
        name: 'Sencha',
        launch: InitializeApp
    });
    
    
    function InitializeApp() {
        Ext.define('Contact', {
            extend: 'Ext.data.Model',
            config: {
                fields: ['firstName', 'lastName']
            }
        });
    
    
        var store = Ext.create('Ext.data.Store', {
            model: 'Contact',
            sorters: 'lastName',
            //autoLoad: true,
            grouper: {
                groupFn: function (record) {
                    return record.get('lastName')[0];
                }
            },
    
    
            data: [
               { firstName: 'Tommy', lastName: 'Maintz' },
               { firstName: 'Rob', lastName: 'Dougan' },
               { firstName: 'Ed', lastName: 'Spencer' },
               { firstName: 'Jamie', lastName: 'Avins' },
               { firstName: 'Aaron', lastName: 'Conran' },
               { firstName: 'Dave', lastName: 'Kaneda' },
               { firstName: 'Jacky', lastName: 'Nguyen' },
               { firstName: 'Abraham', lastName: 'Elias' },
               { firstName: 'Jay', lastName: 'Robinson' },
               { firstName: 'Nigel', lastName: 'White' },
               { firstName: 'Don', lastName: 'Griffin' },
               { firstName: 'Nico', lastName: 'Ferrero' },
               { firstName: 'Nicolas', lastName: 'Belmonte' },
               { firstName: 'Jason', lastName: 'Johnston' }
           ]
        });
    
    
        var mainList = Ext.create('Ext.List', {
            //centered: true,
            fullscreen: false,
            width: '300px',
            itemTpl: '<div class="contact">{firstName} <strong>{lastName}</strong></div>',
            store: store,
            grouped: false,
            onItemDisclosure: true
        });
    
    
        var mainPanel = Ext.create('Ext.Panel', {
            fullscreen: true,
            layout: {
                type: 'hbox',
                align: 'middle'
            }
        });
    
    
        mainPanel.add(mainList);
    }

  2. #2
    Sencha - Senior Forum Manager mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    35,704
    Answers
    3356
    Vote Rating
    751
    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


    I see you are using hbox layout for the panel and your list has a width config but no height. The list doesn't know what height to use.
    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.

Thread Participants: 1

Tags for this Thread

film izle

hd film izle

film sitesi

takipci kazanma sitesi

takipci kazanma sitesi

güzel olan herşey

takipci alma sitesi

komik eğlenceli videolar