nextPage() not working when the Items filtered

Hi everyone, I need your help regarding this matter. I already did a lot of research testing out the code but it did not work. I’m on the bridge of giving up already.

As you can see I have this option to filter some of the categories I have in my database.

On my database I have more than 12 I.T jobs available. Let’s say I have 15 jobs and I already set the repeater Item limit into 12 so I got page 2 for the remaining three items. I tried to implement this code

$w('#dynamicDataset').nextPage()

But when I try to use that code the filter will reset back to normal. It does not go to next 3 remaining items for I.T Jobs. Which is the page 2.

I have this code to search and filter my database

$w.onReady(() => {
    $w("#input1, #dropdown1, #dropdown2, #dropdown3").onChange(function () {
    search();
    });
});
function search() {
    wixData.query("Jobs").contains("title", String($w("#input1").value))
    .and(wixData.query("Jobs").contains("category", String($w("#dropdown1").value)))
    .and(wixData.query("Jobs").contains("workLocations", String($w("#dropdown2").value)))
    .and(wixData.query("Jobs").contains("jobLevel", String($w("#dropdown3").value)))
    .ascending("title").limit(12)
    .find()
    .then(results => {
        $w("#repeater1").data = results.items
        $w('#pagination1').totalPages = results.totalPages
        $w('#dynamicDataset').refresh
        });
}

I have this code to limit the items into 12

.ascending("title").limit(12)

I also have this code for pagination to get the total number of pages

$w('#pagination1').totalPages = results.totalPages

and this is the result

I already try this code using buttons but its not working.

$w("#myDataset").nextPage()
  .then( (items) => {
    let firstItem = items[0];
    let fieldValue = firstItem.fieldName;
  } )
  .catch( (err) => {
    let errMsg = err.message;
    let errCode = err.code;
  } );

Do you guys have any other reference for this?

Problem solved. Thank you for helping me out. :slight_smile: