GithubHelp home page GithubHelp logo

Comments (4)

dhilt avatar dhilt commented on August 14, 2024

@agscheidle Hi Andrew! I think you may be interested in following issues: #49, #46. The second one is about pagination approach for uiScroll directive and here is callback-based Datasource.get implementation example. This approach could be applied also to Observable-based .get. But if we are talking about remote source of data and http requests, I would suggest you to build a cache layer (described in issue 46).

from ngx-ui-scroll.

agscheidle avatar agscheidle commented on August 14, 2024

Hi @dhilt, the outline in #46 is actually the approach we have, and it generally works. The issue seems to be that despite calling adapter.reload() when the data in the middle cache layer (ngrx entity reducer has all the paged buffer, and a selector returns a slice of that data set), the scroll bottom is reached and cannot continue further.

The fundamental issue that prevents this from working for us (I suspect) is the true scroller height compared to the 'virtual' height. A scroller that truly had 1k records in it would calculate a scrollbar and scroll handle position that was much different than one calculated on only the buffer size (in my case 15 items). To truly scroll through an infinite and virtual scroll, one needs to know the total records that will be scrolled through, which is a value usually returned in a paged data set.

I will keep plugging away to get this to a point where at least the scroll handle jumps back up a few pixels to allow for more pages, but at present I can't seem to see even that work.

from ngx-ui-scroll.

dhilt avatar dhilt commented on August 14, 2024

@agscheidle Is it correct that the problem is that the uiScroll prevents forward scrolling right after Adapter.reload() is called? Skipping infrastructure details, this behaviour is managed by Buffer.eof property (end-of-file), which is set to true when the size of downward fetched item list is less than Settings.bufferSize (15 in your case). Can you check how many items are being fetched via Datasource.get() right after reload? Maybe it would be helpful if you turn on the uiScroll internal logging via undocumented Datasource.devSettings.debug set to true (it logs, among other things, "get" method results).

from ngx-ui-scroll.

dhilt avatar dhilt commented on August 14, 2024

Since the first major release, pages-based datasource implementation had been included in the list of official demo samples (link).

from ngx-ui-scroll.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.