0

I need to implement an infinite scroll, that is, as the user scrolls in a grid that has "potentially" thousands of items. Initially I have an SDT and it is the one I show on the grid.

The idea is that:

  1. The SDT loads from 20 to the cursor position

  2. Show those 20 in the grid

  3. Save the cursor position

This should be quick. As the user scrolls down, cycle 1, 2 and 3 are repeated until finished. So as not to overload the grid.

The most similar thing I found in the wiki is this:

http://wiki.genexus.com/commwiki/servlet/wiki?21311,HowTo%3A+External+Services+%28Scenario2%29,

Where variables count, Start (to say how many to load and from which position of the query to load) and the sdt that load the values ​​are defined. The point is that it is not clear to me how it works.

It loads in LOAD but nowhere do I see that the value of the Start variable is updated so I would always be loading the same 20 items.

If someone implements something so I can approach an explanation, some clue or a welcome xpz !!

Greetings and thanks

matiash
  • 54,791
  • 16
  • 125
  • 154
bcamargo75
  • 115
  • 7
  • I'm voting to close this question as off-topic because it is written in Spanish. Should be translated or moved to stackoverflow.es – Marcos Crispino Feb 24 '17 at 13:24

1 Answers1

0

First of all, grids based on attributes already have this paging/infinite scrolling behavior on by default. I assume you are asking about grids based on variables.

The values of the &start and &count variables are automatically managed, and sent, by the GeneXus Smart Devices client application. The idea is that the service just needs to return the records in this range, and the client will automatically request more as the user scrolls.

Although it shouldn't have an effect on the service's implementation, the particulars are:

  • &start has the current (total) number of records returned by the service so far.
  • &count is a fixed value. It's the one set on the Rows property of the grid.

Therefore, the first request will have &start = 0 and &count = 10 (by default). The second request will have &start = 10 and &count = 10, then &start = 20 and so forth.


Note: It's important that if the client requests X elements, then exactly X are returned by the service. If this doesn't occur, then the client will assume that the data source is exhausted, and will make no more requests.

matiash
  • 54,791
  • 16
  • 125
  • 154