Results 1 to 2 of 2

Thread: Getting card indexes on Container.onActiveItemChange()

  1. #1
    Ext JS Premium Member
    Join Date
    Apr 2010
    Location
    Omaha, NE
    Posts
    631
    Vote Rating
    41
      0  

    Default Getting card indexes on Container.onActiveItemChange()

    After a lot of experimenting I got it to work but not confident this is the best way to do it. What I want to do is when navigating back remove the old card on my NavigationView (I'm not using the built in Back button). Here is what I came up with but wondering if there is a better/safer way?

    Code:
        onActiveItemChange: function(container, value, oldValue, opts) {
            var me = this,
                newIdx = Ext.Array.indexOf(value.parent.getInnerItems(), value),
                oldIdx = Ext.Array.indexOf(value.parent.getInnerItems(), oldValue);
    
    
            if (newIdx < oldIdx) {
                me.remove(oldValue);
            }
        }

  2. #2
    Sencha User mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    40,062
    Vote Rating
    1391
      0  

    Default

    Should be just fine.
    Mitchell Simoens @LikelyMitch
    Modus Create, Senior Frontend Engineer
    ________________
    Need any sort of Ext JS help? Modus Create is here to help!

    Check out my GitHub:
    https://github.com/mitchellsimoens

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •