1. #1
    Sencha User
    Join Date
    Jul 2012
    Location
    Bangalore
    Posts
    113
    Vote Rating
    0
    kramprabhu is on a distinguished road

      0  

    Default Prev Next button in Card Layout

    Prev Next button in Card Layout


    Hi

    In my card layout subsequent page I access as this.setActiveItem(1), this.setActiveItem(2) ....
    In every page I put button and calling above setActiveItem to navigate to prev and next page.

    I need this to be done dynamic.. like having docked toolbar in the bottom and have two buttons 'Prev' and 'Next.
    I dont want to specify the 1, 2, 3 in setActiveItem().. as it looks hardcoding.

    Is there any way we can find out what the the current ActiveItem index. so that I can make (index-1) (index+1) in my 'Prev' and 'Next' buttons

    Thanks
    -Ram

  2. #2
    Sencha - Senior Forum Manager mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    36,522
    Vote Rating
    814
    mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute

      0  

    Default


    You need to get the container that has the card layout, the index of the active item from that container and then add/subtract 1 from that index.
    Mitchell Simoens @SenchaMitch
    Sencha Inc, Senior Forum Manager
    ________________
    Check out my GitHub, lots of nice things for Ext JS 4 and Sencha Touch 2
    https://github.com/mitchellsimoens

    Think my support is good? Get more personalized support via a support subscription. https://www.sencha.com/store/

    Need more help with your app? Hire Sencha Services services@sencha.com

    Want to learn Sencha Touch 2? Check out Sencha Touch in Action that is in print!

    When posting code, please use BBCode's CODE tags.

  3. #3
    Sencha User
    Join Date
    Jul 2012
    Location
    Bangalore
    Posts
    113
    Vote Rating
    0
    kramprabhu is on a distinguished road

      0  

    Default


    Hi
    Can you paste some sample code. please
    -Ram

  4. #4
    Sencha User
    Join Date
    Jul 2012
    Location
    Bangalore
    Posts
    113
    Vote Rating
    0
    kramprabhu is on a distinguished road

      0  

    Default


    Hi
    Can you paste some sample code. please
    -Ram

Thread Participants: 1

Tags for this Thread