Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8135625
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T10:28:51+00:00 2026-06-06T10:28:51+00:00

I am looking for a solution to display many items (10’s of thousands) in

  • 0

I am looking for a solution to display many items (10’s of thousands) in a list view in Yii. I would like to be able to display them in a continually scrollable list. Here is the catch, when the user scrolls past the end of the list I want the new data to replace the data he just scrolled passed. Kind of like google music if you have a really long play list.

I looked at Yiinfinite-scroller but it appends to the end of the list making a very long list which is killing my memory usage.

Thanks

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-06T10:28:52+00:00Added an answer on June 6, 2026 at 10:28 am

    Its actuality really easy to implement infinite scroll in just a few lines of js and with the help of jQuery. Measure the height of the content div and as the page scrolls subtract the scroll difference from the divs height then when it hit the min amount do the query for more content and reset the height counter and repeat:

    <script type="text/javascript">
    var contentHeight = 4000,;
    var pageHeight = document.documentElement.clientHeight;
    var scrollPosition;
    var n = 1;
    
    function scroll(){
        if(navigator.appName == "Microsoft Internet Explorer")
            scrollPosition = document.documentElement.scrollTop;
        else
            scrollPosition = window.pageYOffset;
    
        if((contentHeight - pageHeight - scrollPosition) < 500){
            $.ajax({ url: "./yourAPI/?next="+n, cache: false,
            success: function(data){
                //append result
                $('#infscroll').append('<div>'+data.result+'</div>');
            }, dataType: "json"});
            n += 1;
            contentHeight += 4000;
        }
    }
    
    $(document).scroll(function(){
        setInterval('scroll();', 250);
    });
    </script>
    
    <div id="infscroll"></div>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have simple application, that shows list of many items, where user can display
I'm looking for solution how can run Ruby script without invoking it directly like
I would like to make a big display by putting monitors side by side.
I'm looking for a solution to display a PDF in C#. I found the
I'm looking for a solution to display successive frames in one window using OpenCV.
I am looking for the solution to list all the files from root/Android device.
I am looking for a solution, preferably a 3rd party component, to open/display MS
I am looking for a javascript solution to display rankings across time. Being familiar
I am looking for an optimized solution to display image in different screen size.
I'm looking for solution to extract some node from large xml file (using xmlstarlet

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.