Results 1 to 5 of 5

Thread: Can be list cycled?

  1. #1
    Sencha User
    Join Date
    Jul 2012
    Posts
    61
    Answers
    1
    Vote Rating
    0
      0  

    Default 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 - Sr Software Engineer mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    39,556
    Answers
    3931
    Vote Rating
    1272
      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 @LikelyMitch
    Sencha Inc, Senior Software Engineer
    ________________
    Learn BBCode and use it! Checkout the CODE tag!

    Check out my GitHub, lots of nice things for Ext JS and Sencha Touch
    https://github.com/mitchellsimoens

  4. #3
    Sencha User
    Join Date
    Jul 2012
    Posts
    61
    Answers
    1
    Vote Rating
    0
      0  

    Default

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

  5. #4
    Sencha - Sr Software Engineer mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    39,556
    Answers
    3931
    Vote Rating
    1272
      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 @LikelyMitch
    Sencha Inc, Senior Software Engineer
    ________________
    Learn BBCode and use it! Checkout the CODE tag!

    Check out my GitHub, lots of nice things for Ext JS and Sencha Touch
    https://github.com/mitchellsimoens

  6. #5
    Sencha User
    Join Date
    Jul 2012
    Posts
    61
    Answers
    1
    Vote Rating
    0
      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)

Tags for this Thread

Posting Permissions

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