PDA

View Full Version : Overlapping Cardlayout items - Please help.



kiran277
20 Jan 2011, 1:21 AM
I have a Card layout Panel. While I am trying to reload the same card layout, Seems that all the controls in the panel is overlapping.


Please find below the code for creating the main panel.



var cardPanel = {
xtype : 'container',
id : 'createDashboardCardPanel',
layout:'card',
height: 500,
layoutOnCardChange : true,
layoutConfig: {
deferredRender: true,
align: 'center'
},
activeItem: 'dashboardListPanel',
items : [dashboardListPanel, dashBoardWizardPanel]

};

var myPanel = new Ext.Panel( {

layout:'fit',
width: '100%',
height: 575,
renderTo: document.getElementById('panel-basic'),

items : [cardPanel],
autoScroll: true

});
});

in the dashboardListPanel, it contains some more panels. Here I am trying to call the panels, using


cardPanel.getLayout().setActiveItem('myPnael1');Here first time it is working with out any issue. But if we call the same agin, all the components in the myPnael1, gets overlapped. Any Idea ??? Please Help.....

kiran277
24 Jan 2011, 9:17 PM
No Reply ???? Anybody any idea ????

ikokostya
25 Jan 2011, 12:41 AM
Try update layout manually:


cardPanel.getLayout().setActiveItem('myPnael1');
cardPanel.doLayout();

kiran277
25 Jan 2011, 12:51 AM
Thanks ikokostya (http://www.sencha.com/forum/member.php?173425-ikokostya) for the quick reply.

I have already do the above mentioned cardPanel.doLayout(); call manually. But doesn't work..
Is there any difference between setActiveItem(Ext.getCmp('id')) and setActiveItem('StringID');

ikokostya
25 Jan 2011, 12:59 AM
In setActiveItem() need pass string component id or numeric index of the item to activate. Ids must be unique.

kiran277
25 Jan 2011, 2:30 AM
Yea.. That is OK in my side. But the issue still exist ... Any idea ?

ikokostya
25 Jan 2011, 3:12 AM
What is 'myPanel1'? Your dashboardListPanel has id='dashboardListPanel', because

activeItem: 'dashboardListPanel',
Use


cardPanel.getLayout().setActiveItem('dashboardListPanel');

for select dashboardListPanel and


cardPanel.getLayout().setActiveItem('dashBoardWizardPanel');

for select dashBoardWizardPanel if dashBoardWizardPanel has id 'dashBoardWizardPanel'