# How to display the elements of a repeater gradually?

**URL:** <https://forum.wixstudio.com/t/how-to-display-the-elements-of-a-repeater-gradually/32060>\
**Category:** Ask the community\
**Tags:** question, code\
**Created:** [October 13, 2020, 9:16am UTC](https://forum.wixstudio.com/t/how-to-display-the-elements-of-a-repeater-gradually/32060 "2020-10-13T09:16:05Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![kikevelasquez22](https://sea1.discourse-cdn.com/wix/user_avatar/forum.wixstudio.com/kikevelasquez22/32/11255_2.png) [@kikevelasquez22](https://forum.wixstudio.com/u/kikevelasquez22)\
**Post date:** [October 13, 2020, 9:16am UTC](https://forum.wixstudio.com/t/how-to-display-the-elements-of-a-repeater-gradually/32060/1 "2020-10-13T09:16:05Z")

</div>

I have a filter or query that is displayed in a repeater, but I don’t want all the results to be displayed at the same time, I want a button to be pressed to gradually display the repeating items, how can I do that?  
… Investigating a little, I understood that with the graphical interface of the editor the functionality that I want can be achieved, however it does it with all the elements of the database … what I want is that it is only the data of the filter or query that I currently have in the repeater.

I think I need a function in the button that allows me to gradually show the repeater elements, but I don’t understand how the repeater works, that is, how it displays its elements on the screen.  
Can anybody help me? Please!

---

<div class="post-metadata">

**Author:** ![ajithkrr](https://sea1.discourse-cdn.com/wix/user_avatar/forum.wixstudio.com/ajithkrr/32/20520_2.png) [@ajithkrr](https://forum.wixstudio.com/u/ajithkrr)\
**Post date:** [October 13, 2020, 11:31am UTC](https://forum.wixstudio.com/t/how-to-display-the-elements-of-a-repeater-gradually/32060/2 "2020-10-13T11:31:15Z")

</div>

Is this what you are trying to achieve →   
[https://www.wix.com/corvid/reference/wix-dataset/introduction#wix-dataset\_introduction\_dataset-pages](https://www.wix.com/corvid/reference/wix-dataset/introduction#wix-dataset_introduction_dataset-pages)  
[https://www.wix.com/corvid/reference/wix-dataset/dataset/loadmore](https://www.wix.com/corvid/reference/wix-dataset/dataset/loadmore)

---

<div class="post-metadata">

**Author:** ![kikevelasquez22](https://sea1.discourse-cdn.com/wix/user_avatar/forum.wixstudio.com/kikevelasquez22/32/11255_2.png) [@kikevelasquez22](https://forum.wixstudio.com/u/kikevelasquez22)\
**Post date:** [October 14, 2020, 7:54am UTC](https://forum.wixstudio.com/t/how-to-display-the-elements-of-a-repeater-gradually/32060/3 "2020-10-14T07:54:13Z")

</div>

Thanks but I still can’t get it, in the dataset there are 50 elements which are shown in the repeater, however I apply several search filters on them to obtain a reduced data set, let’s suppose 9 elements in the repeater, now I want to that those 9 elements can be shown gradually…the functions you mentioned do it but not to the 9 elements if not to all the 50 elements of the dataset, how could I gradually show those 9 elements that I mentioned?

---

<div class="post-metadata">

**Author:** ![ajithkrr](https://sea1.discourse-cdn.com/wix/user_avatar/forum.wixstudio.com/ajithkrr/32/20520_2.png) [@ajithkrr](https://forum.wixstudio.com/u/ajithkrr)\
**Post date:** [October 14, 2020, 8:15am UTC](https://forum.wixstudio.com/t/how-to-display-the-elements-of-a-repeater-gradually/32060/4 "2020-10-14T08:15:19Z")

</div>

@kikevelasquez22 I think this is _ **one of** _ the method →   
**(not tested)**

#repeater1 - repeater  
#button1 button1  
#container1 - container in the repeater

```javascript
let num = 0;
$w("#repeater").onItemReady( ($item, itemData, index) => {
if(index === num) {
$item('#container1').expand();
}
else {
$item('#container1').collapse();
 }

});

$w('#button1').onClick((event) => {
 num = Number(num) + 1;
 }); 

```

---

<div class="post-metadata">

**Author:** ![kikevelasquez22](https://sea1.discourse-cdn.com/wix/user_avatar/forum.wixstudio.com/kikevelasquez22/32/11255_2.png) [@kikevelasquez22](https://forum.wixstudio.com/u/kikevelasquez22)\
**Post date:** [October 16, 2020, 5:25am UTC](https://forum.wixstudio.com/t/how-to-display-the-elements-of-a-repeater-gradually/32060/5 "2020-10-16T05:25:32Z")

</div>

Thanks, the code didn’t work, but it gave me a similar idea of ​​how the problem could be fixed, and well, all I did was get the query array, i.e. all 9 elements and with the slice function ( start, end), adding 2 to the end of the function each time a button is pressed  
Something like this:

```javascript
 var num = 2;
 $w('#repeater1').data = await consulta
        .find()
        .then((res) => {

            $w('#button1').onClick((event) => {
                num = Number(num) + 2;
            });
 return res.items.slice(0, num);
            
        });

```

---

<div class="post-metadata">

**Author:** ![ajithkrr](https://sea1.discourse-cdn.com/wix/user_avatar/forum.wixstudio.com/ajithkrr/32/20520_2.png) [@ajithkrr](https://forum.wixstudio.com/u/ajithkrr)\
**Post date:** [October 16, 2020, 6:15am UTC](https://forum.wixstudio.com/t/how-to-display-the-elements-of-a-repeater-gradually/32060/6 "2020-10-16T06:15:47Z")

</div>

@kikevelasquez22 The code I gave also worked fine for me !!!
