Hello, as the title says, I can’t find a solution to this problem on my personal page for anime and games, so I would appreciate any help since my knowledge in code is super super basic. Please …
So this is the code that I use together with the filter which work perfectly:
import wixData from “wix-data”;
$w.onReady( function () {
//TODO: write your page related code here…
$w(“#table1”).columns = [
{
“id”: “col1”,
“dataPath”: “ename”,
“label”: “Anime”,
“width”: 100,
“visible”: true ,
“type”: “string”,
“linkPath”: “link-anime-title”
},
{ “id”: “col2”,
“dataPath”: “icon”,
“label”: “Icon”,
“width”: 100,
“visible”: true ,
“type”: “image”,
“linkPath”: “”
},
{
“id”: “col3”,
“dataPath”: “genre”,
“label”: “Genre”,
“width”: 60,
“visible”: true ,
“type”: “string”,
“linkPath”: “”
},
{
“id”: “col4”,
“dataPath”: “synopsis”,
“label”: “Synopsis”,
“width”: 100,
“visible”: true ,
“type”: “string”,
“linkPath”: “”
}];
});
export function button4_click() {
let searchvalue = $w(‘#input1’).value;
$w(‘#dataset1’). setFilter(wixData.filter().contains(‘ename’,searchvalue) .or(wixData.filter().contains(‘synopsis’,searchvalue).or(wixData.filter().contains(‘genre’,searchvalue)))))
.then(res => {
$w(‘#table1’).rows = res.items;
});
}
Now, what I want is that depending on the selection in a dropdown switch field “ename” with other two fields on the same collection named “jname” and “sname” and applying the corresponding filter to them.
Also, I would like to add that I have a referenced field, “animators” and I have tried to parse the field with “text”, “string” even “number” without success, just got an [object] or "a big number like a field ID as a result. This is NOT a must, but any idea about this is much appreciated.
Thanks.!