Hello.
I want that if I put "0" or if a space in my database is "empty" Dont appear.
My code:
import wixData from 'wix-data';
export function btnSearch1_click_1(event) {
filterCasas();
}
function filterCasas(){
$w("#propertiesDataset").setFilter(wixData.filter()
.contains('propertieType', $w('#dropdown11').value)
.between('bedrooms', parseFloat($w('#dropdown33').value), parseFloat($w('#dropdown66').value))
.between('pricefilter', parseFloat($w('#dropdown44').value), parseFloat($w('#dropdown55').value))
)
//.then((results) => {
// console.log('Dataset is now filtered');
if ($w('#propertiesDataset').getTotalCount() !== 0) {
console.log('Showing Results!');
$w('#propertiesRepeater').expand();
console.log($w('#propertiesDataset').getItems());
} else {
$w('#propertiesRepeater').collapse();
console.log('No Results...');
}
// }).catch((err) => {
// console.log(err);
// });
//$w("#propertiesRepeater").expand();
}
My code
I do think that they basically want the properties repeater to collapse if nothing in a specific field or expanded if there is some data value of some sort.
Something like this previous forum posts if they had searched first might help them.
https://www.wix.com/corvid/forum/community-discussion/solved-collapsing-empty-image-fields-in-a-repeater-help-please
https://www.wix.com/corvid/forum/community-discussion/solved-collapse-only-empty-text-fields-for-repeater-items
https://www.wix.com/corvid/forum/community-discussion/hide-image-element-if-empty
Your question is not so clear.
What do you mean by " if I put "0" or if a space in my database is "empty" ". If you put "0" where? What is a space in the database (certain field value?).
Please elaborate.