@russian-dima noooooo let me try it with a video answer:
left CBG Bundesland= #CB1
right CBG Sprachkenntnisse = #CB2 + #CB21 + #CB22 , because of fortging 3 groups
and here the project (code) - i can cry
import wixLocation from "wix-location";
import {session} from 'wix-storage';
import wixData from 'wix-data';
var selected
$w.onReady(function () {
const title1 = session.getItem('geschlecht'); $w('#DD1').value = title1;
const title2 = session.getItem('nationalitat'); $w('#DD2').value = title2;
const title3 = session.getItem('verfugbarkeit'); $w('#DD3').value = title3;
const title4 = session.getItem('ausbildung'); $w('#DD4').value = title4;
const title5 = session.getItem('berufserfahrung'); $w('#DD5').value = title5;
//const title6 = session.getItem('bundesland1'); $w('#CB1').value = title6;
//const title7 = session.getItem('sprachen'); $w('#CB2').value = title7;
//const title8 = session.getItem('sprachen'); $w('#CB21').value = title8;
//const title9 = session.getItem('sprachen'); $w('#CB22').value = title9;
$w('#CB1').options = [
{"label": "Burgenland", "value": "Burgenland"},
{"label": "Kärnten", "value": "Kärnten"},
{"label": "Niederösterreich", "value": "Niederösterreich"},
{"label": "Oberösterreich", "value": "Oberösterreich"},
{"label": "Salzburg", "value": "Salzburg"},
{"label": "Steiermark", "value": "Steiermark"},
{"label": "Tirol", "value": "Tirol"},
{"label": "Vorarlberg", "value": "Vorarlberg"},
{"label": "Wien", "value": "Wien"},
];
$w('#CB21').options = [
{"label": "Irisch", "value": "Irisch"},
{"label": "Italienisch", "value": "Italienisch"},
{"label": "Kroatisch", "value": "Kroatisch"},
{"label": "Lettisch", "value": "Lettisch"},
{"label": "Litauisch", "value": "Litauisch"},
{"label": "Maltesisch", "value": "Maltesisch"},
{"label": "Niederländisch", "value": "Niederländisch"},
{"label": "Polnisch", "value": "Polnisch"},
];
$w('#CB22').options = [
{"label": "Portugiesisch", "value": "Portugiesisch"},
{"label": "Rumänisch", "value": "Rumänisch"},
{"label": "Schwedisch", "value": "Schwedisch"},
{"label": "Slowakisch", "value": "Slowakisch"},
{"label": "Slowenisch", "value": "Slowenisch"},
{"label": "Spanisch", "value": "Spanisch"},
{"label": "Tschechisch", "value": "Tschechisch"},
{"label": "Ungarisch", "value": "Ungarisch"},
];
//--------------------------------------------------------------------------------
$w('#CB2').options = [
{"label": "Bulgarisch", "value": "Bulgarisch"},
{"label": "Dänisch", "value": "Dänisch"},
{"label": "Deutsch", "value": "Deutsch"},
{"label": "Englisch", "value": "Englisch"},
{"label": "Estnisch", "value": "Estnisch"},
{"label": "Finnisch", "value": "Finnisch"},
{"label": "Französisch", "value": "Französisch"},
{"label": "Griechisch", "value": "Griechisch"},
];
//Datenspeicherung....
//let Status = local.getItem('Status'); $w('#DD0').value = Status;
//let Geschlecht = local.getItem('Geschlecht'); $w('#DD1').value = Geschlecht;
//let Nationalitat = local.getItem('Nationalitat'); $w('#DD2').value = Nationalitat;
//let Verfugbarkeit = local.getItem('Verfugbarkeit'); $w('#DD3').value = Verfugbarkeit;
//let ausbildung = local.getItem('ausbildung'); $w('#DD4').value = ausbildung;
//let berufserfahrung = local.getItem('berufserfahrung'); $w('#DD5').value = berufserfahrung;
//let bundesland1 = local.getItem('bundesland1'); $w('#CB1').value = bundesland1;
//let sprachen = local.getItem('sprachen'); $w('#CB1').value = sprachen;
//--------------------------------------------DropDownFelder_sichttbar_machen_start
wixData.query("Team")
.limit(100)
.find()
.then(results => {
const uniqueTitles0 = getUniqueTitles0(results.items);
const uniqueTitles1 = getUniqueTitles1(results.items);
const uniqueTitles2 = getUniqueTitles2(results.items);
const uniqueTitles3 = getUniqueTitles3(results.items);
const uniqueTitles4 = getUniqueTitles4(results.items);
const uniqueTitles5 = getUniqueTitles5(results.items);
const uniqueTitles6 = getUniqueTitles6(results.items);
const uniqueTitles7 = getUniqueTitles7(results.items);
$w("#DD0").options = buildOptions0(uniqueTitles0); //---> STATUS
$w("#DD1").options = buildOptions1(uniqueTitles1); //---> ANREDE
$w("#DD2").options = buildOptions2(uniqueTitles2); //---> NATIONALITÄT
$w("#DD3").options = buildOptions3(uniqueTitles3); //---> VERFÜGBARKEIT
$w("#DD4").options = buildOptions4(uniqueTitles4); //---> AUSBILDUNG
$w("#DD5").options = buildOptions5(uniqueTitles5); //---> BERUFSERFAHRUNG
});
function getUniqueTitles0(items) {const titlesOnly = items.map(item => item.status); return [...new Set(titlesOnly)];}
function buildOptions0(uniqueList0) {return uniqueList0.map(curr => {return {label:curr, value:curr};});}
function getUniqueTitles1(items) {const titlesOnly = items.map(item => item.anrede); return [...new Set(titlesOnly)];}
function buildOptions1(uniqueList1) {return uniqueList1.map(curr => {return {label:curr, value:curr};});}
function getUniqueTitles2(items) {const titlesOnly = items.map(item => item.nationalitat); return [...new Set(titlesOnly)];}
function buildOptions2(uniqueList2) {return uniqueList2.map(curr => {return {label:curr, value:curr};});}
function getUniqueTitles3(items) {const titlesOnly = items.map(item => item.verfugbarkeit); return [...new Set(titlesOnly)];}
function buildOptions3(uniqueList3) {return uniqueList3.map(curr => {return {label:curr, value:curr};});}
function getUniqueTitles4(items) {const titlesOnly = items.map(item => item.ausbildung); return [...new Set(titlesOnly)];}
function buildOptions4(uniqueList4) {return uniqueList4.map(curr => {return {label:curr, value:curr};});}
function getUniqueTitles5(items) {const titlesOnly = items.map(item => item.berufserfahrung); return [...new Set(titlesOnly)];}
function buildOptions5(uniqueList5) {return uniqueList5.map(curr => {return {label:curr, value:curr};});}
function getUniqueTitles6(items) {const titlesOnly = items.map(item => item.bundesland1); return [...new Set(titlesOnly)];}
function buildOptions6(uniqueList6) {return uniqueList6.map(curr => {return {label:curr, value:curr};});}
function getUniqueTitles7(items) {const titlesOnly = items.map(item => item.sprachen); return [...new Set(titlesOnly)];}
function buildOptions7(uniqueList7) {return uniqueList7.map(curr => {return {label:curr, value:curr};});}
})
//-------------------------------------------------------------DropDownFelder_sichttbar_machen_ende
//----------- USER-INTERFACE / настройки ------------------------------------------- User-Interface
var DATABASE = "database1"
var DATASET = "#dataset1"
var REFERENCE1 = "status"
var REFERENCE2 = "anrede"
var REFERENCE3 = "nationalitat"
var REFERENCE4 = "verfugbarkeit"
var REFERENCE5 = "ausbildung"
var REFERENCE6 = "berufserfahrung"
var REFERENCE7 = "bundesland1"
var REFERENCE8 = "sprachen"
//---------------------------------- USER-INTERFACE / настройки -------------------- User-Interface
export function DD0_change(event) {SEARCH_ENGINE(), $w('#table1').refresh()}
export function DD1_change(event) {SEARCH_ENGINE() ,session.setItem('geschlecht', $w('#DD1').value); $w('#table1').refresh()}
export function DD2_change(event) {SEARCH_ENGINE() ,session.setItem('nationalitat', $w('#DD2').value); $w('#table1').refresh()}
export function DD3_change(event) {SEARCH_ENGINE() ,session.setItem('verfugbarkeit', $w('#DD3').value); $w('#table1').refresh()}
export function DD4_change(event) {SEARCH_ENGINE() ,session.setItem('ausbildung', $w('#DD4').value); $w('#table1').refresh()}
export function DD5_change(event) {SEARCH_ENGINE() ,session.setItem('berufserfahrung', $w('#DD5').value); $w('#table1').refresh()}
export function CB1_change(event) {SEARCH_ENGINE() , $w('#table1').refresh()}
export function CB2_change(event) {SEARCH_ENGINE() ,session.setItem('sprachen', $w('#CB2').value); $w('#table1').refresh()}
export function CB21_change(event) {SEARCH_ENGINE() ,session.setItem('sprachen', $w('#CB21').value); $w('#table1').refresh()}
export function CB22_change(event) {SEARCH_ENGINE() ,session.setItem('sprachen', $w('#CB22').value); $w('#table1').refresh()}
export function BTNsearch_click(event) {SEARCH_ENGINE(), $w('#table1').refresh()}
async function SEARCH_ENGINE() {
let filter = wixData.filter()
let item1, item2, item3, item4, item5, item6, item7, item8
//DD1-DD5 = DropDowns
if ($w('#DD0').value!=0) {item1 = $w('#DD0').value}
if ($w('#DD1').value!=0) {item2 = $w('#DD1').value}
if ($w('#DD2').value!=0) {item3 = $w('#DD2').value}
if ($w('#DD3').value!=0) {item4 = $w('#DD3').value}
if ($w('#DD4').value!=0) {item5 = $w('#DD4').value}
if ($w('#DD5').value!=0) {item6 = $w('#DD5').value}
//DD1-DD5 = DropDowns
if ($w('#CB1').value[0]!==undefined) {item7 = $w('#CB1').value}
if ($w('#CB2').value[0]!==undefined) {item8 = $w('#CB2').value}
if ($w('#CB21').value[0]!==undefined) {item8 = $w('#CB21').value}
//----------------------------------------------------------------------------------------------------------------------------
// if(typeof item1=="string"){item1 = Number($w('#DD1').value)}
// if(typeof item3=="string"){item3 = Number($w('#DD3').value)}
console.log(item1)
console.log(typeof item1)
if (item1!=0) {filter = filter.eq(REFERENCE1, item1)}
if (item2!=0) {filter = filter.eq(REFERENCE2, item2)}
if (item3!=0) {filter = filter.eq(REFERENCE3, item3)}
if (item4!=0) {filter = filter.eq(REFERENCE4, item4)}
if (item5!=0) {filter = filter.eq(REFERENCE5, item5)}
if (item6!=0) {filter = filter.eq(REFERENCE6, item6)}
if (item7!==undefined) {console.log("item7 in action")
for (var i = 0; i < item7.length; i++) {
filter = filter.eq(REFERENCE7, item7[i])
console.log("Gewähltes- Bundesland ( " + i + " ) = " + item7[i] )
console.log($w('#CB1').value[0])
}
}
else {console.log("Kein Bundesland ausgewählt")}
if (item8!==undefined) {console.log("item8 in action")
for (var i = 0; i < item8.length; i++) {
filter = filter.eq(REFERENCE8, item8[i])
console.log("Gewählte Sprache ( " + i + " ) = " + item8[i] )
}
}
else {console.log("Keine Sprache ausgewählt")}
console.log(filter)
await $w(DATASET).setFilter(filter)
.then(()=>{
let count = $w(DATASET).getTotalCount().toString();
console.log("COUNT = " + count)
$w('#treffer').text = count.toString()
})
}
//----------------------------------------------------------------------------------------
//Resert_Button
export function resetfilter_click(event, $w) {
$w("#DD0").selectedIndex = undefined;
$w("#DD1").selectedIndex = undefined;
$w("#DD2").selectedIndex = undefined;
$w("#DD3").selectedIndex = undefined;
$w("#DD4").selectedIndex = undefined;
$w("#DD5").selectedIndex = undefined;
{
let count = $w(DATASET).getTotalCount().toString();
console.log("COUNT = " + count)
$w('#treffer').text = count.toString()
}
}