I am writing cording to display filtered contents from a collection in a repeater. The filter is working fine. But when the value of filter is set to “null” (undefined) to display all content, nothing is appeared in the reperater. What could be the cause?
Repro Video
Dropdown items and value
Code
import wixData from ‘wix-data’ ;
$w . onReady ( function () {
});
export function iptSortOrder_change_1 ( event ) {
if ( $w ( ‘#iptSortOrder’ ). value === ‘Alphabetically’ ) {
$w ( “#dbArtists” ). setSort ( wixData . sort ()
. ascending ( “artists” )
);
} **else if** ( $w ( '#iptSortOrder' ). value === 'Birth Year' ) {
$w ( "#dbArtists" ). setSort ( wixData . sort ()
. ascending ( "born" )
);
} **else if** ( $w ( '#iptSortOrder' ). value === 'Newest' ) {
$w ( "#dbArtists" ). setSort ( wixData . sort ()
. descending ( "_createdDate" )
);
}
}
function filterResults ( genre ) {
**var** newFilter = wixData . filter ();
newFilter = newFilter . eq ( 'genre' , genre );
$w ( '#dbArtists' ). setFilter ( newFilter );
console . log ( newFilter );
console . log ( 'genre' );
console . log ( genre );
}
export function iptSerachGenre_change_1 ( event ) {
**var** adjGenre ;
**if** ( $w ( '#iptSerachGenre' ). value !== 'All' ) {
adjGenre = $w ( '#iptSerachGenre' ). value ;
}
filterResults ( adjGenre );
}