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
    St. Louis, MO
    Posts
    33,582
    Vote Rating
    433
    mitchellsimoens has much to be proud of mitchellsimoens has much to be proud of mitchellsimoens has much to be proud of mitchellsimoens has much to be proud of mitchellsimoens has much to be proud of mitchellsimoens has much to be proud of mitchellsimoens has much to be proud of mitchellsimoens has much to be proud of mitchellsimoens has much to be proud of

      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
    ________________
    http://www.JSONPLint.com - Source to lint your JSONP!

    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 almost 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

Tags for this Thread