简体   繁体   中英

md-virtual-repeat refresh and stay in scroll index

I have a list of md-virtual-repeat.

While scrolling I want to refresh from server.

What i currently do is recreate the list object:

$scope.dynamicItems = new DynamicItems();

But it takes the list back to top (scroll Index 0).

How can I "refresh" the list (get Viewd pages and clear the rest) and still remain on the same scrolled index?

Codepan Example

Got it!

Just needed to reset the inner loadedPages.

DynamicItems.prototype.reset = function() {
      this.loadedPages = {};
};

CodePen Demo

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM