PDA

View Full Version : setActiveItem in card layout + effect



nick saint
13 Jul 2010, 10:26 PM
hi, is it possible to add an effect, for example slideIn, when changing the active items in card layout?



contentPanel.add(carAlternat);
contentPanel.doLayout();
contentPanel.layout.setActiveItem('carAlternat'); + effect Thank you
Nick

Animal
14 Jul 2010, 12:42 AM
I've played with crossfading between cards.

Maybe there's something in here that can help: http://www.sencha.com/forum/showthread.php?47317-CardLayout-override-which-fades-the-cards-in-out

nick saint
14 Jul 2010, 5:09 AM
Thank you Animal, but I cannot get how to make it work
in the beggining I have only one item in card layout


var corePanel = {
id: 'corePanel',
layout: 'card',
activeItem: 0,
region: 'center',
border: false,
//bodyStyle: 'padding-bottom:15px;background:#eee;',
autoScroll: true,
layoutConfig: { animate: true },
items: [carItems]
}

later on I add atems and make it active

contentPanel.add(carAlternat);
contentPanel.doLayout();
contentPanel.layout.setActiveItem('carAlternat');
how can I add an effect to it?

Sorry for bugging
Thank you
Nick

Animal
14 Jul 2010, 5:17 AM
Is it not working? Maybe it needs tweaking for 3.2

nick saint
15 Jul 2010, 12:58 AM
wired. I have 3.2.1.

Righi
21 Jul 2010, 8:15 PM
Animal, if I use your override, I can't use "expand" command to expand an accordion. Do you know why?