Hi guys, I have a question, hope anyone can help me, kind of lost here….
I have a repeater that I’ve connected to a dataset. Since the DB should include around 75 items, I use a pagination bar, and everything is sweet. I added “show-more / show-less” button to hide and reveal a few text elements [I will refer those elements as 'additional-text'] in the repeater (accordion.) On load it works fine, the (first) page is loading the additional-text collapsed, with “show more” button (for every item in the page) as it should be.
Now, here is the problem – when I use the pagination bar to load the next few items (next page), instead of hiding the additional-text, the site shows it, and also, the button is “show more” (when the text is shown it should be “show less.”)
I’ve added an onClick event to the bar, and now it loads the new items without the additional text, yet after a sec (when the page is fully loaded) the additional text revealed.
Now, here is more information that may help to solve this mystery:
when use the pagination bar to revisit a page (e.g., from 1/10 to 2/10 and back to 1/10) the additional text on this page (e.g., 1/10) is hidden, and the button is “show more” as it should be.
I’ve tried to use “next page” and “previews page” actions on buttons instead of the pagination bar, and the additional text is always shown on every page but the first one.
I guess that I should add this code to a reload function or something like that, but I have no idea how to do that, to be honest, I’m not even sure it possible at the moment.
$w("#paperAbstract").text = shortText; //text element $w("#citePaper").collapse(); //text element $w("#showMoreLess").label = "Show more"; //this is the button
Thank you in advance, d.