1
votes

I have a fairly simple Sencha Touch MVC app where I have some main tabs (containing lists) driven by a tab bar. When the user taps on a list item I open a new panel using SetActiveItem. This seems ok but it adds an icon (or the empty clickable space) to the tab bar. How can I stop this?

My viewport:

app.views.Viewport = Ext.extend(Ext.TabPanel, {
    fullscreen: true,                                
    layout: 'card',
    cardSwitchAnimation: 'slide',

    initComponent: function() {

        // put instances of cards into app.views namespace
        Ext.apply(app.views, {
             myList: new app.views.MyList(),
             myDetail: new app.views.MyDetail()
             ...
        });

        //put instances of cards into viewport
        Ext.apply(this, {
            tabBar: {
                dock: 'bottom',
                layout: {
                    pack: 'center'
                }
            },
            items: [
            app.views.myList,
             ...
            ]
        });
        app.views.Viewport.superclass.initComponent.apply(this, arguments);                             
    }
});

I then have a controller that fires on an item tap in my list:

app.views.viewport.setActiveItem(
                app.views.myDetail,
                options.animation
            );

The panel opens but adds to the tabbar as well.

I'd appreciate any pointers!

1

1 Answers

0
votes

What you need to do is change the layout of myList and the other tabPanel items to card layout, and call setActiveItem in the context of myList.

When you call setActiveItem directly on the TabPanel, this is the result that you get ( another item being added to the tabBar). Besides, you don't need to set the layout to card in the TabPanel as it is already card layout by default.

The inner items (myDetail for example) should have a fit layout.