[SOLVED] Hide repeater with pagination

Hello! I am trying to collapse a repeater after a user clicks a ‘clear search’ button, but the repeater only hides when the last result of the pagination is viewed. How can I make it so that the repeater will hide even if the user does not go to the last result?

Here is what I have in terms of my code:

export function button18_click(event) {
        $w('#repeater1').hide();
        $w('#pagination1').hide();
}

Here is the link to my (not published yet) website: http://wix.to/3sD4AJo. Go to the menu and locate Coaching > Meet Our Coaches page to view the page I am referring to.
Thank you so much for your time and help!

Hi @joanneh !

Have you tried to put the repeater & the pagination element in a strip?
Try to collapse the strip itself instead of the elements.

Doron.

P.s
If that doesn’t work please share a link to your published site / editor (and not to the feedback page as you posted) - one of us, the Wix Code team, will inspect your site and provide you with a solution.

Thank you for your reply @doron-alkalay . Turns out there was a very simple solution to my issue, all I had to do was put $w(’ #repeater1 ‘).collapse(); before $w(’ #repeater1 ').hide(); and it finally hides the repeater when a search is cleared! For those from the future who happen to stumble upon my post with a similar issue here is the solution:

 export function button_click(event) { 
      $w('#repeater1').collapse();
      $w('#repeater1').hide(); 
      $w('#pagination1').hide(); 
 } 

Cheers! :smiley:

@joanneh If you’re doing a collapse() you probably don’t need to bother with hide(). At least it works OK for my implementations.

Hi Peps,

I thought this was the answer to my query. You literally not hiding the repeater with pagination instead hiding repeater and pagination with button onClick.

I posted another question titled almost like these. I need to show the repeater with pagination onchange but I have to make sure the repeater’s element are indeed updated with the data of next page before showing it. I wanted to make the transition smooth and dont confuse visitors if repeater next page will be loaded or not.

Any thoughts would be great helpful.

Thanks,
DA