The viewport enter function is not getting logged after the dataset loads 2-3 times. You have to scroll all the way back above, and then down again towards the column strip for the viewport to enter again.
Can someone help out? https://www.timesharenation.com/timeshares This has currently over 100+items in the database. Watch that nothing happens 2-3 times after the data loads if you keep scrolling.
@allu112apina Doesn’t help unfortunately. Actually getting stuck after the first load. Tried to have a setInterval function too but did not help. Tearing my hair out for such a simple thing. The loading is supposed to be fast.
@jaoshsethna
What are you getting when you just use Nayeli’s code as it is without the dataset onReady?
export function viewStrip_viewportEnter(event) {
$w("#loadmore").show(); //This is your GIF or animated image
$w("#dataset1").loadMore() //This is your dataset
.then(() => {
$w("#loadmore").hide(); //This is your GIF or animated image
console.log("Done loading more data");
});
}
I tested your linked site and all I am getting is the first repeater with the three items and then the loading gif and that is it, nothing else happens after that.
Is that using the code that you have with the dataset onReady?
Don’t forget that @Code Queen Nayeli is already in this forum, so as you are using her code you can always try contacting her to see what she suggest as well.
Although, I can’t guarantee a quick response as that will always depend on how busy she is etc, etc.
Take note as well that when Nayeli’s page first loads up the connected repeater is not shown on the page itself, the only thing that she has set above the page fold is the header with the menu and picture.
So, in theory her page is loaded before you scroll down the page and get to the actual repeater that is set up with load more from the dataset.
Whereas with your website page the repeater is included in the first things that you see above the fold, so the website has to load that first along with then the dataset and that again depends on the size used here.
You can try changing your page design so that the first repeater is not above the page fold and so is not loaded first as in Nayeli’s page with the fact that you have to scroll down in the first place to reach the first viewport point.
As for using the Wix Dataset API and the loadMore function from it.
If you have to have the repeater at the top, then try adding the loadMore function to to the onReady part as in the API Reference.
In theory, that way it should load the first next part of your setup when the page loads and that should then give the page enough time for the user to scroll down to the next viewpoint for the page to recognise it correctly.
Assuming you have already, however take a read of the loadMore function info.
Note
A dataset needs to load its data before you call its loadMore() function. Usually a dataset finishes loading a short time after the page it is on finishes loading. So if you call loadMore() inside the page’s onReady() event handler, the dataset might not be ready yet.
To call loadMore() as soon as possible after a page loads, use the dataset’s onReady() function inside the page’s onReady() event handler to ensure that both the page and the dataset have finished loading.
Finally, have a look at thus previous post too, as another way is discussed to, so that you are not loading all of your dataset up in one go.
I did reach out to Nayeli. She was helpful with the time she gave to it. but the situation remained the same with her original code also. I’ll try for the cosmetic changes but I think the viewportEnter still won’t fire after the first 2-3 batches. Let me see. The whole point of this was to make the data load faster yet look seamless.
On the other hand, https://www.timesharenation.com/timeshares-free-week loads perfectly with the same Nayeli code, but I’ve just used a button instead of a loader gif. This doesn’t look seamless though. This should be a pretty simple thing so I am not sure where the problem lies
Reading what someone else wrote above and what GOS mentioned about the placement … regarding the repeater and Strip …try checking a couple a few things …
See if the page was manually extended instead of auto adjusted when the load more strip was added. If it was manually extended, it may not be moving as smoothly as it should when loading more content. It may be getting stuck above the fold after it finishes loading more items, meaning it will require user to scroll up a little then down again to trigger the code on viewport in.
Also try to trigger code when the page is ready and then trigger again once or twice after that.
I use this function often, especially on sites that have large amounts of records, but I usually trigger it using 9 or 12 records as default in the dataset settings for the reason that the load more strip remains out of view to trigger the code as soon as it comes into view again.
Thanks for the replies. Made a fresh new page with the repeaters and strips. Page resizes automatically when the strip is added. Added 11 items to load at once.
you can see the two —> STRIPES which are (red marked) in the example i puted into my last post.
one is at the absolute top of the page (you can see it, when you scroll to the TOP)
the other at the absolute bottom (you can see it, when you scroll to the BOTTOM)
All you have to do is —> to create 2 thin stripes (about 5px or even less)
the name-IDs of the STRIPES i already gave you…
a) “STARTstrip”
b) “ENDstrip”
Set-up 4x the Viewport-Events and let’s go
Yes of course it’s not the best sollution, but sometimes you have to be tricky, if you are not a PRO.
@jaoshsethna
" Just not sure now if I am doing something intrinsically wrong!"
It could be the case.
Look at this video:
If i just scroll between these:
Westgate Lakes Resort And Spa Orlando, Florida Westgate Lakes Resort & Spa in Orlando, Florida, provides guests all the comforts of a fully furnished home with accommodations ranging from studios to spacious four-bedroom villas, all within minutes of Orlando’s world-famous theme parks and attractions. Stay Free In 2020 More Info Your Text Here Vacation Village At Parkway Kissimmee, Florida This expansive resort with modern buildings 7-10 stories high, is 6.4 miles from the Magic Kingdom, 9 miles from SeaWorld and 12.3 miles from Universal Studios Orlando. Stay Free In 2020 More Info Your Text Here Sheraton Vistana Resort Orlando, Florida Enjoy a warm welcome and an unforgettable stay at the Sheraton Vistana Resort Villas, Lake Buena Vista/Orlando. Spread over 135 acres of tropical landscaping, with seven refreshing pools and eight whirlpools, our destination resort places recreation at your feet. Stay Free In 2020
It loads more stuff.
It must be that your box doesn’t move with those other listings. It just stays between those 3…
Not sure how this is possible because it should move the box and also act like it :S
Maybe someone who can access your editor can help, or just try to make it again from scratch.
The thing is that it works well in the preview section but gives a wix sdk warning. It does not work on the live website
Wix code SDK Warning: The data that was passed to data contained at least two items with the same ID: 3e112032-c0e9-4226-b508-fd1bd9936b63. Only the first item was accepted.
the warning is for multiple IDs. There are no duplicates in the database.
The thing is that it works well in the preview section but gives a wix sdk warning. It does not work on the live website
Wix code SDK Warning: The data that was passed to data contained at least two items with the same ID: 3e112032-c0e9-4226-b508-fd1bd9936b63. Only the first item was accepted.
The warning is for multiple IDs. There are no duplicates in the database.