I have a repeater that I built successfully collapse and expand code for the repeater itself and for each item in the repeater, without problem. But when I came to this I couldn’t make it.
So here the challenge:
I have a page with one Repeater: $w(‘#repeter) and two Datasets: $w(’#dataset1) and $w(‘#dataset2). Also I have two collections with the names: Self Service and Full Service.
I would like to create a code as following:
If user hits the button #w(’#Button1), the repeater will connect to $w(‘#dataset1), and retrieve data from collection Self Service.
If user hits the button #w(’#Button2), the repeater will connect to $w('#dataset2), and retrieve data from collection Full Service.
The both collections have the same structure and the same items: title (text), subTitle (text), description (text), image1 (image) image2 (image).
Anyone can help me to build this code?
Thank you so much
Why not just make it much simpler and have two repeaters with one repeater for each dataset and simply have them both hidden on load and only shown when the user selects which one they prefer to see.
Or you simply have the one repeater and dataset shown with the other one hidden and you simply switch between the shown one and hidden one on a button click like you have suggested in your original post.
Otherwise, you will have to look into using reference fields with multiple datasets and I don’t think that is what you are trying to achieve here and show data from two collections in the one repeater etc.
Thanks for your response.
That’s the exact situation now. I working with two separate repeaters.
I try to find an elegant way, to get the same results by code. Reference is option, and if I’ll not find a code, I’ll use it.