Hello, I tried hard but couldn’t have the same working with dataset filter, not query.
I will be very glad if someone can help me.
Here are the codes:
Code with query, that works:
import wixData from 'wix-data'
$w.onReady(function () {
$w('#searchButton').onClick(function () {
wixData.query("RepertoireList")
.contains("songName", $w("#searchInput").value)
.or(wixData.query("RepertoireList")
.contains("artistName", $w("#searchInput").value))
.find()
.then((results) => {
let resultsItems = results.items;
console.log(resultsItems);
$w('#resultsTable').rows = resultsItems;
})
})
})
The same code, changed for working with dataset, not working
import wixData from 'wix-data'
$w.onReady(function () {
$w('#searchButton').onClick(function () {
$w("#dataset2").setFilter(wixData.filter()
.contains("songName", $w("#searchInput").value)
.or($w("#dataset2").setFilter(wixData.filter()
.contains("artistName", $w("#searchInput").value)))
.find()
.then((results) => {
let resultsItems = results.items;
console.log(resultsItems);
$w('#resultsTable').rows = resultsItems;
)
})
})
})
Thanks In Advance!!!