1. #1
    Sencha User
    Join Date
    Feb 2012
    Posts
    6
    Vote Rating
    1
    hanguokai is on a distinguished road

      0  

    Default scrollToEnd() after store.add is incorrect

    scrollToEnd() after store.add is incorrect


    I create a DataView for message list.
    And add a new message, then for scroll to end to see this new message :

    DataView .getStore().add({...});
    DataView .getScrollable().getScroller().scrollToEnd();


    But scrollToEnd() scroll to the previous message, not show the new message.
    scrollToEnd() seem didn't see the new message immediately.
    But I delay 200ms to do this, it's ok.
    Is add message asynchronous?

  2. #2
    Sencha - Sencha Touch Dev Team Jamie Avins's Avatar
    Join Date
    Mar 2007
    Location
    Redwood City, California
    Posts
    3,661
    Vote Rating
    19
    Jamie Avins is a jewel in the rough Jamie Avins is a jewel in the rough Jamie Avins is a jewel in the rough

      0  

    Default


    Store loading is asynchronous, you would need to add this to the addrecords event of the store.

    Sencha Inc

    Jamie Avins

    @jamieavins

  3. #3
    Sencha User
    Join Date
    Feb 2012
    Posts
    6
    Vote Rating
    1
    hanguokai is on a distinguished road

      0  

    Default


    I test addrecords event in the store , but it's also the same problem.

  4. #4
    Sencha User
    Join Date
    Feb 2012
    Posts
    5
    Vote Rating
    0
    sniper69 is on a distinguished road

      0  

    Default Same problem, any suggestion?

    Same problem, any suggestion?


    scroll to end of list after new record added, this is pretty common usage, any suggestion to make it happen?

  5. #5
    Ext GWT Premium Member
    Join Date
    Jul 2010
    Posts
    17
    Vote Rating
    0
    Philippe Quemener is on a distinguished road

      0  

    Post


    Perhaps just like this?

    Code:
    list.onAfter('refresh', function()
    {
           list.getScrollable().getScroller().scrollToEnd();
    });

  6. #6
    Sencha User
    Join Date
    Apr 2014
    Posts
    3
    Vote Rating
    0
    Tristan559 is on a distinguished road

      0  

    Default Not working for me either

    Not working for me either


    Even using the addrecords event has the same problem.

    It seems the event is firing before the ListView is updated with the new records.

    When I call scrollToEnd(), it is scrolling to the previous record, not the new record that was just added that triggered the addrecords event.

    Anyone have any suggestions?

film izle

hd film izle

film sitesi

takipci kazanma sitesi

takipci kazanma sitesi

güzel olan herşey

takipci alma sitesi

komik eğlenceli videolar