Results 1 to 4 of 4

Thread: CardLayout: _index_ of the active item ?

  1. #1
    Sencha User
    Join Date
    Jul 2010
    Posts
    119

    Default CardLayout: _index_ of the active item ?

    Hi there,

    I'm building this dynamic wizard in which the order of the cards might not be in the same order depending on user inputs.

    The object returned by CardLayout.activeItem() only has an id property, not an index (ie: is the activeItem the 5th, 3rd or first card in the lot?)

    Having an index property would really simplify my tasks. (ie: regardless of the id, when I press next, I want to go to next page)

    Do you have any advices ? Perhaps my method needs tweaking...

    Thanks!

    EDIT: I just tried:

    PHP Code:
    var lay Ext.getCmp('wizardForm').getLayout();
    var 
    Ext.getCmp('wizardForm').items.indexOf(lay.activeItem.id);
    console.log(l); 
    But that returns -1 all the time (?)

  2. #2
    Sencha User fay's Avatar
    Join Date
    Apr 2007
    Location
    Ireland
    Posts
    1,750

    Default

    use indexOfKey

    Code:
     
    var lay = Ext.getCmp('wizardForm').getLayout();
    var l = Ext.getCmp('wizardForm').items.indexOfKey(lay.activeItem.id);

  3. #3
    Sencha Premium Member steffenk's Avatar
    Join Date
    Jul 2007
    Location
    Haan, Germany
    Posts
    2,675

    Default

    Code:
    var l = Ext.getCmp('wizardForm').getActiveTab();
    vg Steffen
    --------------------------------------
    Release Manager of TYPO3 4.5

  4. #4
    Sencha User
    Join Date
    Jul 2010
    Posts
    119

    Default

    Neither does BasicForm or FormPanel have a getActiveTab() method.

    fay's solution works great though.

    Thanks

Similar Threads

  1. how can i set active item ?
    By SanWoo in forum Ext 2.x: Help & Discussion
    Replies: 11
    Last Post: 31 May 2012, 1:59 AM
  2. How to get a cardlayout stateful and remember the current item
    By ts-gbtec in forum Ext 3.x: Help & Discussion
    Replies: 1
    Last Post: 11 Mar 2011, 3:26 AM
  3. how to make the unactived item's component in the cardlayout to render?
    By enotsl in forum Ext 2.x: Help & Discussion
    Replies: 1
    Last Post: 9 Oct 2008, 5:49 AM
  4. Replies: 3
    Last Post: 4 Jun 2008, 9:41 PM
  5. [SOLVED] CardLayout: How to Dynamically Add an Item?
    By Emmster in forum Ext 2.x: Help & Discussion
    Replies: 2
    Last Post: 19 Dec 2007, 9:58 AM

Posting Permissions

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