# Pagination query results to repetear

**URL:** <https://forum.wixstudio.com/t/pagination-query-results-to-repetear/49024>\
**Category:** Ask the community\
**Created:** [June 3, 2022, 4:48pm UTC](https://forum.wixstudio.com/t/pagination-query-results-to-repetear/49024 "2022-06-03T16:48:36Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![feliperojas](https://sea1.discourse-cdn.com/wix/user_avatar/forum.wixstudio.com/feliperojas/32/10932_2.png) [@feliperojas](https://forum.wixstudio.com/u/feliperojas)\
**Post date:** [June 3, 2022, 4:48pm UTC](https://forum.wixstudio.com/t/pagination-query-results-to-repetear/49024/1 "2022-06-03T16:48:36Z")

</div>

Hi! Im loading data to a repeater from this Query:  
function traerPedidos ( ) {  
wixData . query ( “Pedidos” )  
. include ( ‘producto’ , ‘cliente’ )  
. limit ( 3 )  
. find ()  
. then ( ( results ) =\> {  
console . log ( “Pedidos2.items” , results . items );  
pedidos2 = results ;  
$w ( ‘#tabla’ ). data = pedidos2 . items ;  
let fadeOptions = { “duration” : 500 , “delay” : 0 };  
$w ( ‘#loadingTable’ ). hide ();  
$w ( ‘#boxTabla’ ). show ( ‘fade’ , fadeOptions );  
});  
}

Then, when the button “next” is clicked it should show the next items, and when the “prev” is click it should show the previous items:

function pagination ( ) {  
//When button next is clicked:  
$w ( “#btnNext” ). onClick ( ( event ) =\> {  
pedidos2 . next ()  
. then ( function ( results ) {  
console . log ( “Lote:” , results . items );  
pedidos = results ;  
$w ( ‘#tabla’ ). data = pedidos . items ; //Change data of the repeater with the next items.  
});  
});

```
$w ( "#btnPrev" ). onClick ( ( event ) => { 
    pedidos2 . prev () 
    . then ( function ( results2 ) { 
        console . log ( "Lote:" , results2 . items ); 
        pedidos = results2 ; 
        $w ( '#tabla' ). data = pedidos . items ; //Change data of the repeater with the prev items. 
    });  
}); 

```

}

The thing is that it only show one time the next 3 items, but then nothing happens (for “next()” or “prev()”). The repeater stays the same.

Any help for what could be happening?

---

<div class="post-metadata">

**Author:** ![AndrewT](https://sea1.discourse-cdn.com/wix/user_avatar/forum.wixstudio.com/andrewt/32/32103_2.png) [@AndrewT](https://forum.wixstudio.com/u/AndrewT)\
**Post date:** [June 7, 2022, 8:48am UTC](https://forum.wixstudio.com/t/pagination-query-results-to-repetear/49024/2 "2022-06-07T08:48:18Z")

</div>

hi, @feliperojas  
on Editor X Forum it is more easier to find design and Editor X canvas materials and replies, but if we are talking about code related question, we can suggest you to visit our [Velo Forum](https://www.wix.com/velo/forum) and [Community X Facebook group](https://www.facebook.com/groups/editorxcm?sorting_setting=CHRONOLOGICAL) , we got a lot of code experts there

---

<div class="post-metadata">

**Author:** ![feliperojas](https://sea1.discourse-cdn.com/wix/user_avatar/forum.wixstudio.com/feliperojas/32/10932_2.png) [@feliperojas](https://forum.wixstudio.com/u/feliperojas)\
**Post date:** [June 7, 2022, 2:35pm UTC](https://forum.wixstudio.com/t/pagination-query-results-to-repetear/49024/3 "2022-06-07T14:35:58Z")

</div>

Ok! Thanks Andrii :+1:
