Hello, the code below works. I will filter by drop down and the results will show in the text fields (fields 2,4, and 6). But when I try adding the 4th data set and the text field for the the results to show, it will not filter and will just stay blank. The other 3 text fields will filter and display with no problem. I seem to run into trouble when I add that 4th data set and 4th text field to be filtered.
The text in green is what I added, but wont filter and display results. Other 3 work fine (Red, Blue, Yellow), not sure what the problem is.
import wixData from ‘wix-data’ ;
$w.onReady( function
()
{ });
export function button1_click(event, $w) {
let generalFilter = wixData.filter()
.eq( “size” , $w( ’ #dropdown1 ’ ).value)
.contains( “weight” , $w( ’ #dropdown2 ’ ).value)
.contains( “height” , $w( ’ #dropdown3 ’ ).value)
let RedFilter = generalFilter.eq("color " , “Red” );
let BlueFilter = generalFilter.eq( “color” , “Blue” );
let YellowFilter = generalFilter.eq( “color” , “Yellow” );
let OrangeFilter = generalFilter.eq(“color”, “Orange”); // This line was added but wont filter like the others
Promise.all(
[$w( ’ #dataset1 ’ ).setFilter(RedFilter)]
[$w( ’ #dataset2 ’ ).setFilter(BlueFilter)]
[$w( ’ #dataset3 ’ ).setFilter(YellowFilter)]
[ $w(’ #dataset4 ').setFilter(OrangeFilter)] // This line was added but wont filter like the others
) .then(() =>{
$w( ’ #text2 ’ ).expand();
$w( ’ #text4 ’ ).expand();
$w( ’ #text6 ’ ).expand();
$w(’ #text8 ').expand(); // This line was added but wont filter like the others
})
}
Thank you for your help!