1. #1
    Sencha User
    Join Date
    Jul 2012
    Posts
    43
    Answers
    1
    Vote Rating
    0
    indapublic is on a distinguished road

      0  

    Default Answered: Can be list cycled?

    Answered: Can be list cycled?


    I want cycled behaviour: when the list is over, it should start from the beginning. Is it possible?

  2. You can listen to the scrollend event on the Scroller and then scroll to the top...

    Code:
    var scroller = list.getScrollable().getScroller();
    
    function onScrollEnd() {
        this.scrollToTop(true); //true for anim, false for no anim
    }
    
    scroller.on('scrollend', onScrollEnd, scroller);

  3. #2
    Sencha - Senior Forum Manager mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    37,330
    Answers
    3541
    Vote Rating
    846
    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 can listen to the scrollend event on the Scroller and then scroll to the top...

    Code:
    var scroller = list.getScrollable().getScroller();
    
    function onScrollEnd() {
        this.scrollToTop(true); //true for anim, false for no anim
    }
    
    scroller.on('scrollend', onScrollEnd, scroller);
    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.

  4. #3
    Sencha User
    Join Date
    Jul 2012
    Posts
    43
    Answers
    1
    Vote Rating
    0
    indapublic is on a distinguished road

      0  

    Default


    Can you give this example for
    Code:
    xtype: 'list'
    , please?

  5. #4
    Sencha - Senior Forum Manager mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    37,330
    Answers
    3541
    Vote Rating
    846
    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


    The code I gave will work for a list hence it using the list variable that you have to come up with (resolve)
    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.

  6. #5
    Sencha User
    Join Date
    Jul 2012
    Posts
    43
    Answers
    1
    Vote Rating
    0
    indapublic is on a distinguished road

      0  

    Default


    Thanks for advice, but scrollend fire when scroll ended, but not list

    So i added condition like:
    Code:
    if (y >= scroller.maxPosition.y)

Thread Participants: 1

Tags for this Thread