kamilkp / angular-vs-repeat

Virtual Scroll for AngularJS ngRepeat directive
http://kamilkp.github.io/angular-vs-repeat/
MIT License
818 stars 228 forks source link

Support to scroll to a particular item #133

Open marcelotavares opened 8 years ago

marcelotavares commented 8 years ago

In previous versions there was the vsScrollSetting attribute that had the scrollIndex property to go to a particular item. But this feature was removed in newer versions and there is no substitute for it.

marcelotavares commented 8 years ago

Proposed solution:

                    $scope.$on('vsScrollToItem', function(event, index) {

                        if(scrollPos=='scrollTop')
                            $scrollParent.scrollTop($scope.sizesCumulative[index]);
                        else
                            $scrollParent.scrollLeft($scope.sizesCumulative[index]);

                    });
mdarveau commented 7 years ago

See https://github.com/kamilkp/angular-vs-repeat/issues/144