Results 1 to 4 of 4

Thread: Too many values after button click to get tab panel with navigation view

  1. #1
    Sencha Premium Member
    Join Date
    Mar 2013
    Posts
    8
    Vote Rating
    0
      0  

    Default Too many values after button click to get tab panel with navigation view

    I have a problem with the visualization of my navigationView.
    This is what the code produces:
    visualizzazione.png
    ..and this is what I want to do:
    visualizzazione_voluta.jpg
    My code is done as follows:
    Code:
    Ext.define('MyApp.view.EntiAbilitati', {    extend: 'Ext.Panel',
    
        config: {        id: 'EntiAbilitati',        layout: {            type: 'vbox'        },        items: [            {                xtype: 'button',                itemId: 'EntraVideate',                text: 'Entra'            }        ],        listeners: [            {                fn: 'onEntraVideateTap',                event: 'tap',                delegate: '#EntraVideate'            }        ]    },    onEntraVideateTap: function(button, e, eOpts) {        var me = this;        Ext.getStore('Ospiti').load({            callback: function(record,options,success){		                if(success){                      me.removeAll();                     me.add(Ext.create(                    'MyApp.view.Videate',{                        layout: {                            type: 'fit'                        }                    }                    )                    );                   }            }        });    } });


    And this is the code of my Tab Panel with the navigationView:

    Code:
    Ext.define('MyApp.view.Videate', {    extend: 'Ext.tab.Panel',
    
        config: {        activeItem: 1,        id: 'Videate',        items: [            {                xtype: 'container',                id: 'Ospiti',                layout: {                    type: 'vbox'                },                items: [                    {                        xtype: 'formpanel',                        height: 80,                        items: [                            {                                xtype: 'searchfield',                                id: 'ricercaUtenti',                                label: 'Cerca ospite:',                                name: 'ricercaUtenti'                            }                        ]                    },                    {                        xtype: 'panel',                        flex: 1,                        layout: {                            type: 'vbox'                        },                        items: [                            {                                xtype: 'navigationview',                                flex: 1,                                id: 'listaUtenti1',                                defaultBackButtonText: 'Indietro',                                items: [                                    {                                        xtype: 'list',                                        title: 'Lista utenti',                                        itemId: 'mylist',                                        hideOnMaskTap: false,                                        itemTpl: [                                            '<div>{NOMEOSPITE}</div>'                                        ],                                        indexBar: {                                            width: 50                                        }                                    }                                ]                            }                        ]                    }                ]            },            {                xtype: 'container',                title: 'Nuovo',                layout: {                    type: 'vbox'                },                items: [                    {                        xtype: 'panel',                        flex: 1,                        layout: {                            type: 'vbox'                        },                        items: [                            {                                xtype: 'selectfield',                                id: 'newLuogoNascita',                                itemId: 'LUOGONASCITA',                                label: 'luogo di nascita',                                name: 'LUOGONASCITA',                                options: [                                    {                                        text: ' ',                                        value: ' '                                    },                                    {                                        text: 'Trento',                                        value: 'Trento'                                    },                                    {                                        text: 'Rovereto',                                        value: 'Rovereto'                                    }                                ]                            },                            {                                xtype: 'textfield',                                id: 'newCodFisc',                                itemId: 'CODFISC',                                label: 'CF',                                name: 'CODFISC'                            }                        ]                    }                ]            }        ],        listeners: [            {                fn: 'onMylistSelect',                event: 'select',                delegate: '#mylist'            },            {                fn: 'onInserisciOspiteTap',                event: 'tap',                delegate: '#mybutton2'            }        ]    },    onMylistSelect: function(dataview, record, eOpts) {        console.log(record.data);        Ext.getCmp('listaUtenti').push({            title: record.data.NOMEOSPITE,            layout:'fit',            items: [            Ext.create('MyApp.view.datiOspite',{                record: record               })            ]        });    } });


    What am I doing wrong? Is the CSS?
    Any help wuold be appreciated! Thanx!
    You can find the full code into the attachment.
    test_tabpanel.zip

  2. #2
    Sencha - Sr Software Engineer mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    39,553
    Answers
    3931
    Vote Rating
    1272
      0  

    Default

    I'm not too sure what you mean by "too many values", also the formatting of your code makes it illegible.
    Mitchell Simoens @LikelyMitch
    Sencha Inc, Senior Software Engineer
    ________________
    Learn BBCode and use it! Checkout the CODE tag!

    Check out my GitHub, lots of nice things for Ext JS and Sencha Touch
    https://github.com/mitchellsimoens

  3. #3
    Sencha Premium User
    Join Date
    Feb 2012
    Location
    Berne, Switzerland
    Posts
    723
    Answers
    42
    Vote Rating
    46
      1  

    Default

    Out of curiosity I downloaded your code and opened it in my IDE. And, I hate to say it, but this is a mess. Apparently this was done in Architect by a Sencha newbie. (please forgive me my harsh words - nothing personal!!) And it is a very good example what happens when you start with Sencha without having some knowledge about its structure. Unfortunately using Architect does not help producing good code (despite what marketing may say), when you don't know what and, more importantly, how you should be doing things. (Just a side note: my first encounter with Sencha Touch was also through Architect - but I quickly abandoned because its not dummy proof ... )

    I took the freedom to refactor your project (at least part of it) and do it my way (and this is, of course, not the only way to do such things!). Just unzip and throw it into your web directory and let it go (f.e. /localhost/testpanel2/). Feel free to ask back if you need some more information.
    https://dl.dropbox.com/u/8085058/dev/TestPanel2.zip

  4. #4
    Sencha Premium Member
    Join Date
    Mar 2013
    Posts
    8
    Vote Rating
    0
      0  

    Default

    No problem man, I'm working with Sencha since 2 weeks Yes, I'm a newbie
    Thakyou for your advice!
    I solved the problem in another way, setting the tabpanel layout: card and the navigationView as vbox.

    PS: sorry mitchellsimoens for my code, but this is a problem of the forum code editor (or maybe because I ctrl+c and ctrl+v from the code tabs of my previous post..)

Posting Permissions

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