Yes, it's a difficult task.
Please look at the example below. It doesn't work ideal, but, I hope, might be helpful for you.
Example
<%@ Page Language="C#" %>
<%@ Register Assembly="Ext.Net" Namespace="Ext.Net" TagPrefix="ext" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title>Ext.NET Example</title>
<ext:ResourcePlaceHolder runat="server" Mode="ScriptFiles" />
<script type="text/javascript" src="resources/js/MyCardLayout.js"></script>
<script type="text/javascript">
var activeIndex = 0;
var rotate = function () {
ContainerMain.layout.setActiveItem(++activeIndex % 3);
};
</script>
</head>
<body>
<ext:ResourceManager runat="server" />
<ext:Container
ID="ContainerMain"
runat="server"
Width="400"
Height="400"
Layout="mycard"
ActiveIndex="0">
<Items>
<ext:Container
runat="server"
Html="Card 1"
StyleSpec="background-color: yellow;" />
<ext:Container
runat="server"
Html="Card 2"
StyleSpec="background-color: green;" />
<ext:Container
runat="server"
Html="Card 3"
StyleSpec="background-color: blue;" />
</Items>
</ext:Container>
<ext:Button runat="server" Text="Rotate">
<Listeners>
<Click Fn="rotate" Buffer="150" />
</Listeners>
</ext:Button>
</body>
</html>
MyCardLayout
Ext.layout.MyCardLayout = Ext.extend(Ext.layout.CardLayout, {
setActiveItem : function (item) {
var ai = this.activeItem,
ct = this.container;
item = ct.getComponent(item);
// Is this a valid, different card?
if (item && ai != item) {
// Changing cards, hide the current one
if (ai) {
ai.el.slideOut("l", {
callback : function () {
ai.hide();
ai.fireEvent('deactivate', ai);
var layout = item.doLayout && (this.layoutOnCardChange || !item.rendered);
// Change activeItem reference
this.activeItem = item;
// The container is about to get a recursive layout, remove any deferLayout reference
// because it will trigger a redundant layout.
delete item.deferLayout;
// Show the new component
item.show();
this.layout();
item.el.slideIn("r");
if(layout){
item.doLayout();
}
item.fireEvent('activate', item);
},
scope : this
});
} else {
var layout = item.doLayout && (this.layoutOnCardChange || !item.rendered);
// Change activeItem reference
this.activeItem = item;
// The container is about to get a recursive layout, remove any deferLayout reference
// because it will trigger a redundant layout.
delete item.deferLayout;
// Show the new component
item.show();
this.layout();
if(layout){
item.doLayout();
}
item.fireEvent('activate', item);
}
}
}
});
Ext.Container.LAYOUTS['mycard'] = Ext.layout.MyCardLayout;