1. #11
    Sencha User
    Join Date
    Sep 2007
    Location
    Tulsa, Oklahoma
    Posts
    178
    Vote Rating
    1
    ckr is on a distinguished road

      0  

    Default


    Great! Everything appears to be working in IE, FF, Chrome (only ones I tested).
    I will leave the demo up for awhile incase others wish to see. Thanks Animal! Thanks Gugman!

    Here was what I finally ended up with code wise:

    Code:
    Ext.override(Ext.layout.CardLayout, {
        setActiveItem : function(item){
            item = this.container.getComponent(item);
            if(this.activeItem != item){
                if (item.rendered && this.animate) {
    
                    Ext.Fx.syncFx();
                    if (this.activeItem) {
    
    //                  Correct top position of card because they have to occupy the same space
    //                  during animation.
                        var n = item.getEl();
                        n.setStyle({
                            position: 'absolute',
                            top: this.container.getLayoutTarget().getPadding('t') + 'px'
                        });
                        this.activeItem.getEl().fadeOut({
                            useDisplay: true,
                            callback: Ext.Component.prototype.hide,
                            scope: this.activeItem
                        });
                    }
                    this.activeItem = item;
                    item.show();
                    this.layout();
                    n.fadeIn({
                        callback: function() {
                            n.setStyle({
                                position: 'relative'
                            });
                        }
                    });
                    Ext.Fx.sequenceFx();
                } else {
                    if(this.activeItem){
                        this.activeItem.hide();
                    }
                    this.activeItem = item;
                    item.show();
                    this.layout();
                }
            }
        }
    });
    Thanks!
    Chuck

  2. #12
    Ext JS Premium Member vishalg's Avatar
    Join Date
    Sep 2007
    Location
    Los Angeles, CA
    Posts
    75
    Vote Rating
    0
    vishalg is on a distinguished road

      0  

    Thumbs up


    Quote Originally Posted by Animal View Post

    Code:
    n.setStyle({
        position: '',
    });
    should remove ',' to use in IE.

    How hard would it be to support different effects ?

    Thanks for this extension animal.

  3. #13
    Sencha User
    Join Date
    Sep 2007
    Location
    Tulsa, Oklahoma
    Posts
    178
    Vote Rating
    1
    ckr is on a distinguished road

      0  

    Default


    Ya that was corrected in my post.

    Also check here there is a demo in that post.
    Thanks!
    Chuck

  4. #14
    Sencha User
    Join Date
    Feb 2008
    Posts
    23
    Vote Rating
    1
    Buzzwords is on a distinguished road

      0  

    Default


    Has this override been incorporated into Extjs 4 proper? Does anyone know?

  5. #15
    Sencha User
    Join Date
    Jul 2010
    Posts
    4
    Vote Rating
    0
    turan is on a distinguished road

      0  

    Default Override that works with ExtJS 4.2.1

    Override that works with ExtJS 4.2.1


    Here is an override that works with ExtJS 4.2.1

    See demo

    Code:
    	Ext.override(Ext.layout.container.Card, {
    		setActiveItem: function (newCard) {
    			var me = this,
    				owner = me.owner,
    				oldCard = me.activeItem,
    				rendered = owner.rendered,
    				newIndex;
    
    
    			newCard = me.parseActiveItem(newCard);
    			newIndex = owner.items.indexOf(newCard);
    
    
    			// If the card is not a child of the owner, then add it.
    			// Without doing a layout!
    			if (newIndex === -1) {
    				newIndex = owner.items.items.length;
    				Ext.suspendLayouts();
    				newCard = owner.add(newCard);
    				Ext.resumeLayouts();
    			}
    
    
    			// Is this a valid, different card?
    			if (newCard && oldCard !== newCard) {
    				// Fire the beforeactivate and beforedeactivate events on the cards
    				if (newCard.fireEvent('beforeactivate', newCard, oldCard) === false) {
    					return false;
    				}
    				if (oldCard && oldCard.fireEvent('beforedeactivate', oldCard, newCard) === false) {
    					return false;
    				}
    
    
    				if (rendered) {
    					Ext.suspendLayouts();
    
    
    					// If the card has not been rendered yet, now is the time to do so.
    					if (!newCard.rendered) {
    						me.renderItem(newCard, me.getRenderTarget(), owner.items.length);
    					}
    
    
    					var handleNewCard = function () {
    						// Make sure the new card is shown
    						if (newCard.hidden) {
    							newCard.show();
    						}
    
    
    						if (!newCard.tab) {
    							var newCardEl = newCard.getEl();
    							newCardEl.dom.style.opacity = 1;
    							if (newCardEl.isStyle('display', 'none')) {
    								newCardEl.setDisplayed('');
    							} else {
    								newCardEl.show();
    							}
    						}
    
    
    						// Layout needs activeItem to be correct, so set it if the show has not been vetoed
    						if (!newCard.hidden) {
    							me.activeItem = newCard;
    						}
    						Ext.resumeLayouts(true);
    					};
    
    
    					var handleOldCard = function () {
    						if (me.hideInactive) {
    							oldCard.hide();
    							oldCard.hiddenByLayout = true;
    						}
    						oldCard.fireEvent('deactivate', oldCard, newCard);
    					};
    
    
    					if (oldCard && !newCard.tab) {
    						var oldCardEl = oldCard.getEl();
    						oldCardEl.fadeOut({
    							callback: function () {
    								handleOldCard();
    								handleNewCard();
    							}
    						});
    
    
    					} else if (oldCard) {
    						handleOldCard();
    						handleNewCard();
    					} else {
    						handleNewCard();
    					}
    
    
    				} else {
    					me.activeItem = newCard;
    				}
    
    
    				newCard.fireEvent('activate', newCard, oldCard);
    
    
    				return me.activeItem;
    			}
    			return false;
    		}
    	});
    Last edited by turan; 27 Sep 2013 at 3:36 PM. Reason: now considers tabpanel

Turkiyenin en sevilen filmlerinin yer aldigi xnxx internet sitemiz olan ve porn sex tarzi bir site olan mobil porno izle sitemiz gercekten dillere destan bir durumda herkesin sevdigi bir site olarak tarihe gececege benziyor. Sitenin en belirgin ozelliklerinden birisi de Turkiyede gercekten kaliteli ve muntazam, duzenli porno izle siteleri olmamasidir. Bu yuzden iste. Ayrica en net goruntu kalitesine sahip adresinde yayinlanmaktadir. Mesela diğer sitelerimizden bahsedecek olursak, en iyi hd porno video arşivine sahip bir siteyiz. "The Best anal porn videos and slut anus, big asses movies set..." hd porno faketaxi