I’m trying to create an onClick event that navigates the user to a specific item element within a data connected repeater.
The button I’m using the onClick event with is on the home page and the repeater is on a page titled “programs”. Each repeater item has a collapsed element (#detailsContainer)… I would like the button to take the user to the expanded detailsContainer of the item titled “Soccer”.
Sorry if this question has already been answered, I’ve been looking through the forum and haven’t found anything that helps.
I’ve already posted a detailed example for such a question (you can try search the forum).
Basically you should add to the button link URL:
?id=the_database_id_of_the_specific_item
Then on the second page, use wixLocation.query.id to get the desired id, then use reapeater.forItems([itemId], ($item)…
and inside the block put $item(#detailsContainer).scrollTo()
Thank you for your help. I searched the forum for a long time but I couldn’t find anything that matched the issue, so that’s why I ended up adding a question.
When I click the button it takes me to the right page and scrolls down to where it seems the #detailsContainer would be positioned, but the container is not expanding and therefore it’s not showing the content that I need it to show.
I now have another similar question, I hope it’s okay to ask it here…
I need a button within that #detailsContainer in the repeater to link to it’s corresponding registration form. The form is within a container (on another page) which expands upon selection of a dropdown box item. The dropdown box is connected to the same content manager as the repeater we discussed above.
Is there a way to get a button click to direct to a page and also automatically select the right item within the dropdown box?
e.g if the user clicks the #registerButton on the ‘Soccer’ repeater item then it should take them to the Registration page and automatically select ‘Soccer’ from the dropdown to show the correct form.