I found that my coding for submit does not work after I added the filtering function of dataset.
What should I do? This time no error message, but the submit action does not work.
Page setup
dataset2: display country
dataset1: filter by selected country at dropdown1, show the corresponding data of selected country by press on the button1.
dataset3: link to a new dataset to save the value inputted on the screen.
dropdown1: link to dataset1 to display the country value
dropdown1: link to dataset3 to save the search criteria.
repeater1: display the filtered result of dataset1.
button1: Submit button, link to dataset3 submit action
and coding page add filtering coding.
Result:
Search button is work.
Data Submit is not working.
import wixData from “wix-data” ;
import { local } from ‘wix-storage’ ;
$w . onReady (() => {
});
let debounceTimer ;
export async function button1_click ( event , $w ) {
// This function was added from the Properties & Events panel. To learn more, visit Velo: Working with the Properties & Events Panel | Help Center | Wix.com
// Add your code for this event here:
$w ( “#dropdown1” ). enable ();
$w ( ‘#dataset1’ ). setFilter ( wixData . filter (). contains ( “country” , $w ( ‘#dropdown1’ ). value ))
. then (()=>{
console . log ( “Dataset is now filtered” );
})
. catch (( err )=>{
console . log ( err );
$w ( ‘#repeater1’ ). expand ();
})
}
export function dropdown1_change ( event ) {
// This function was added from the Properties & Events panel. To learn more, visit Velo: Working with the Properties & Events Panel | Help Center | Wix.com
// Add your code for this event here:
if ( debounceTimer ) {
clearTimeout ( debounceTimer );
debounceTimer = undefined ;
}
debounceTimer = setTimeout (() => {
console . log ( $w ( ‘#dropdown1’ ). value );
}, 5000 );
}