@volkaertskristof So… I’ve tried creating the search bar and it worked fine till I’ve put the collapse/expand term in the code. When the preview loads, it show all the heroes, and whenever I type a name, it collapses ![]()
code
$w.onReady(function () {
$w("#dataset1").onReady( () => {
} );
});
//search bar
import wixData from 'wix-data';
let debounceTimer;
export function input1_keyPress(event) {
if (debounceTimer) {
clearTimeout(debounceTimer);
debounceTimer = undefined;
}
debounceTimer = setTimeout(() => {
filter($w('#input1').value);
}, 200);
}
let lastFilterTitle;
function filter() {
$w('#dataset1').setFilter(
wixData.filter()
.contains("title", $w("#input1").value)
.and( wixData.filter()
)
);
if($w("#input1").value === "title" ||$w("#input1").value === "title" ){
$w("#repeater1").expand()
} else {
$w("#repeater1").collapse()
}
}
I think that something’s off to this line if($w(“#input1”).value === “title” ||$w(“#input1”).value === “title” )
I’ve also checked the dataset to be read & write, and the id field name on the database of the names, its “title”.
There is some kind of an error with the set filter but it didn’t show up till I’ve put the last lines of code I said earlier.