Scroll to Entry slow on 4000+ entry database

@boston85719 here is the test app editor

Page “html-4000” has the table and div tests
Page “rg-4000” has the poor broken RG test

1 Like

@ihsanzainal84 has a good point … retrieving the 4000 rows from the DB and sending them as text to javascript might perform okay. Then no need for a JSON file …

I appreciate all the help. It led me down some routes I hadn’t thought of before. I was able to solve this by utilizing native bubble.io actions as well as a couple of plugins. In the end it’s a simple solution that works well without having to implement a code block (although I’m sure that might be a little more elegant).

Plugins needed:
1T - Index Finder
Detect Scroll Position for RG (You could try the free Scroll Actions plugin, but I couldn’t get it to work and I ran out of patience)

Step 1 - Find the item index that you want to scroll to using the “Index Finder” plugin.
Step 2 - Set a state with that index number. We’ll call it “Index” state.
Step 3 - Set the data source on the RG to use the operator “:Items from #” and set the number as your “Index” state - 28 (or how ever you want to load above desired item).


Step 4 - Use the “Scroll to Entry” action to scroll to your desired entry. It’s almost instantaneous now.
Now, here is the functionality I was looking for:
Step 5 - Create a workflow that triggers when the RG reaches the top of the loaded entries using the “Detect Scroll Position for RG” plugin.

Step 6 - In that workflow:

  • Set the State of “Index” to the current value of “Index” minus 28 (or whatever).
  • Add a 25ms pause before next action (this might need to be longer for the RG to load depending on what it’s loading).
  • Scroll to Entry: Current RG list :item #28.

Once that’s done you should be able to have the appearance of all items loading and the user can then scroll back up the list if needed. It’s a tiny bit clumsy, but it’s fairly smooth. Take a look. This is an entry that is thousands of items in and it loads about 28 more entries every time I scroll up. I’ll most likely increase that number so it doesn’t have to load so often.

infiniteRG

3 Likes