I’m trying to setup example from the example https://www.wix.com/velo/example/service-list
I setup everything like it is on the example inside my project but with different database. Here is the code that I setup and initial load works as expected but browsing within categories loads this error:
An error occurred in one of currentIndexChanged callbacks DatasetError: could not resolve dynamic filter
. Can someone give me the hint?
In attachment is the examples and whole setup:
import wixData from “wix-data” ;
import wixWindow from ‘wix-window’ ;
let isMobile ;
$w . onReady (() => {
isMobile = wixWindow . formFactor === “Mobile” ;
})
function showLoader ( show = false ) {
if ( show === false ) {
$w ( “#servicesLoaderMobile” ). hide ();
$w ( “#servicesLoader” ). hide ();
}
if ( show === true ) {
if ( isMobile === true ) {
$w ( “#servicesLoaderMobile” ). show ();
}
else {
$w ( “#servicesLoader” ). show ();
}
}
}
//-------------Repeater Setup-------------//
// Set up each item in the services repeater as it is loaded. Note that
// most of the repeater elements are populated using a dataset.
export async function servicesRepeater_itemReady ( $item , itemData , index ) {
if ( index === 0 ) {
showLoader ( false );
}
}
// Set the category of services to display.
async function setActiveCategory ( title , queryFilter ) {
$w ( “#servicesRepeater” ). data = ;
// Populate the title text with the given title.
$w ( “#stripTitle” ). text = title ;
showLoader ( true )
// Filter the categories dataset using the given filter.
await $w ( “#categoriesDataset” ). setFilter ( queryFilter );
}
// Scroll down to the displayed services.
function scrollToServiceStrip () {
$w ( “#servicesStrip” ). scrollTo ();
}
/**
- Adds an event handler that runs when the element is clicked.
Read more - @param {$w.MouseEvent} event
*/
export function breatheButton_click_1 ( event ) {
// Create a filter that filters out all services that are not in the Breathe category.
console . log ( wixData . filter (). eq ( “category” , “IMPLANTOLOGIJA” ))
const breatheQuery = wixData . filter (). eq ( "category" , "IMPLANTOLOGIJA" );
// Set the active category to the breathe category.
setActiveCategory ( "IMPLANTOLOGIJA" , breatheQuery );
// Scroll the page to the list of services.
scrollToServiceStrip ();
}
/**
- Adds an event handler that runs when the element is clicked.
Read more - @param {$w.MouseEvent} event
*/
export function moveButton_click_1 ( event ) {
// Create a filter that filters out all services that are not in the Move category.
const moveQuery = wixData . filter (). eq ( “category” , “ORALNA KIRURGIJA” );
// Set the active category to the move category.
setActiveCategory ( “ORALNA KIRURGIJA” , moveQuery );
// Scroll the page to the list of services.
scrollToServiceStrip ();
}
/**
- Adds an event handler that runs when the element is clicked.
Read more - @param {$w.MouseEvent} event
*/
export function nourishButton_click ( event ) {
// Create a filter that filters out all services that are not in the Nourish category.
const nourishQuery = wixData . filter (). eq ( “category” , “PROTETIKA” );
// Set the active category to the nourish category.
setActiveCategory ( “PROTETIKA” , nourishQuery );
// Scroll the page to the list of services.
scrollToServiceStrip ();
}