1. #1
    Sencha User
    Join Date
    Nov 2011
    Posts
    7
    Vote Rating
    0
    Acolytee is on a distinguished road

      0  

    Default Unanswered: TabPanel with Ext.Map

    Unanswered: TabPanel with Ext.Map


    Hi everyone,

    Just started to get into Sencha Touch v2 and seem to be stuck on the simple exercise of displaying Ext.Map component in tab panel. What is the approach in dynamically creating Ext.Map and then adding it to the tab panel?

    Thanks!

  2. #2
    Touch Premium Member
    Join Date
    Nov 2007
    Posts
    38
    Vote Rating
    0
    knifegun is on a distinguished road

      0  

    Default


    Which ST2 version? PR1 or PR2. I was not able to resolve it with PR1.

  3. #3
    Sencha User
    Join Date
    Nov 2011
    Posts
    7
    Vote Rating
    0
    Acolytee is on a distinguished road

      0  

    Default


    PR1... How did you resolve it with PR2 though?

  4. #4
    Sencha User
    Join Date
    Nov 2011
    Posts
    7
    Vote Rating
    0
    Acolytee is on a distinguished road

      0  

    Default RE: Tab Panel

    RE: Tab Panel


    Specifications: Sencha Touch V2 PR2.

    I keep getting "Adding a card to a tab container without specifying any tab configuration" error if I attempt to create a map as part of Panel in the following way, even though second item instantiates just fine:

    Code:
    Ext.application({
        name: 'Sencha',
        launch: function()
        {
            Ext.create('Ext.TabPanel', {
                id: 'TopLevelPanel',
                fullscreen: true,
                tabBarPosition: 'bottom',
                items: [new Ext.Panel({
        items: [{
            xtype: 'map',
            useCurrentLocation: true
        }]}),
                Ext.create('app.views.HomePanel')
                ]
            });
        }
    });
    What is the recommended way of dynamically creating items within panel, because when I use constructor: function(config) it screams of "Uncaught TypeError: Cannot call method 'addCls' of null":
    Code:
    Ext.define('app.views.HomePanel', { 
        extend: 'Ext.Panel',
    
    
        config:{
                        title: 'Destination',
                        iconCls: 'time',
                        cls: 'time',
            
                    },
                    
        constructor: function(config)
        {
    
    
            var map = new Ext.Map({
            useCurrentLocation: true
            });    
        }
    });

  5. #5
    Sencha User
    Join Date
    Jan 2011
    Posts
    77
    Vote Rating
    0
    Answers
    1
    riahut.com is on a distinguished road

      0  

    Default


    Having the same error when trying to add tabs which are Panels to the TabPanel

  6. #6
    Sencha User
    Join Date
    Jan 2011
    Posts
    77
    Vote Rating
    0
    Answers
    1
    riahut.com is on a distinguished road

      0  

    Default


    In order to fix your problem you HAVE to add
    title: 'Some other settings',
    iconCls: 'user'
    with your Panel which contains map and other items

  7. #7
    Sencha User
    Join Date
    Aug 2011
    Location
    Mumbai, India
    Posts
    119
    Vote Rating
    4
    Answers
    11
    Sasha172 is on a distinguished road

      1  

    Default


    You need to add

    iconCls : '',
    title : ''

    to the config:{} array

  8. #8
    Sencha User
    Join Date
    Jan 2012
    Posts
    15
    Vote Rating
    0
    bcichowlas is on a distinguished road

      0  

    Default


    That was truly a useful answer! It would have taken me a long time to come up with the right combination of config, layout, items, etc. being new at this.