usershaf
usershaf

Reputation: 5

Switch views inside a tab of a tabpanel -sencha 2 mvc

I am new to sencha , and I am using sencha 2 mvc.I am having a Tabpanel and the first tab contains a list.When clicking on the button in the list i want to load/switch view of its details with a form..I am unable to find the answer.Please help me asap..

{
    xtype: 'tabpanel',
    baseCls:'tabheader',
    cls:'tab_container',
    scrollable:true,
    tabBarPosition: 'top',
    flex:1,
    items: [
        {
            xtype:'container',
            title:'Sample',
            id:'Sample',
            layout:'card',
            cardSwitchAnimation: 'slide',
            tabBarPosition: 'top',
            items:[
                {
                    title: 'Sample',
                    xtype: 'list',
                    flex:1,
                    store: 'SampleWithoutAgentOffers',
                    itemTpl: '{name}' ,
                    onItemDisclosure: function(record, btn, index) {
                        Ext.Viewport.setActiveItem(1);
                    }
                }                    
            ]
        },
        {
            xtype:'panel',
            html:'hiiii'
        }
    ]
}

On itemdisclosure i want to load view..Please help me..

Upvotes: 0

Views: 1352

Answers (1)

Macy Abbey
Macy Abbey

Reputation: 3887

Please see my edits to your original question, I'm not sure if that configuration you posted would even run in JavaScript.

I fixed your configuration object so it should technically work. However, I don't have visibility into your Viewport object. If what you are trying to do onItemDisclosure is show the panel with html of 'hiii', then you should be doing:

onItemDisclosure: function(record, btn, index) {
    this.parent.setActiveItem(1);
}

Upvotes: 1

Related Questions