Ok, we will switch to → ENGLISH ← so everyone understand what’s going on here inside this post.
I have UPDATED your CODE and made it more UNIVERSAL, so you can use now this code on different pages, without having to code everything, everytime from scratch again and again.
import wixData from "wix-data";
///-------------------- USER-INTERFACE ------------------------------
let filterStartValue = '2024'; // --> This is the starting filter-value your filter will start with.
let ddn = "ddnJahr"; // --> ID of your Dropdown here.
let dataset = 'dataset1'; // --> Dataset-ID here.
let dbField1 = 'jahr'; // --> Database-Filed for --> FILTERING.
let dbField2 = 'date'; // --> Database-Field for --> SORTING.
let sortDirection = 'ascending' // --> Setting the direction of --> SORTING --> (ascending/descending).
///-------------------- USER-INTERFACE ------------------------------
$w.onReady(()=>{$w('#'+ddn).value =filterStartValue;
$w('#'+dataset).onReady(()=>{
set_Filter(dbField1, $w('#'+ddn).value);
set_Sort(dbField2);
$w("#"+ddn).onChange(()=>{
set_Filter(dbField1, $w('#'+ddn).value);
$w('#'+dataset).refresh();
});
$w('#btnReset').onClick(()=>{
let filter = wixData.filter();
set_Sort(dbField2);
$w('#'+dataset).setFilter(filter);
$w('#'+dataset).refresh();
});
});
});
function set_Filter(field, value) {
let filter = wixData.filter();
filter = filter.contains(field, value),
$w('#' + dataset).setFilter(filter);
}
function set_Sort(field) {
let sort = wixData.sort()[sortDirection](field); // Change to descending for opposite order
$w('#' + dataset).setSort(sort);
}
Inside the code 2-functions are included, which will do the following automatically, as soon as you have setted-up the USER-INTERFACE correctly.
- It will start to filter
- It will start to do the sorting.
DO NOT TOUCH THE CODE ITSELF !!!
ALL YOU HAVE TO DO IS → SETTING-UP THE → USER-INTERFACE.
No matter on which page you will paste this code to generate a FILTERING-ENGINE (connected by a DATASET), it will run automatically.
This is the CODE-AREA, where you will have to do all SETUP…
///-------------------- USER-INTERFACE ------------------------------
let filterStartValue = '2024'; // --> This is the starting filter-value your filter will start with.
let ddn = "ddnJahr"; // --> ID of your Dropdown here.
let dataset = 'dataset1'; // --> Dataset-ID here.
let dbField1 = 'jahr'; // --> Database-Filed for --> FILTERING.
let dbField2 = 'date'; // --> Database-Field for --> SORTING.
let sortDirection = 'ascending' // --> Setting the direction of --> SORTING --> (ascending/descending).
///-------------------- USER-INTERFACE ------------------------------
As you can see → it’S working fine now…
About… →
und wenn ich auf Alle gehe, erscheint nichts.
Yes, this is also normal behaviour, because it filters for everything, and you can not filter for everything. A filter should also filter for something specific inside of a big pool of data.
How to solve it ?
What do you think when you are taking a look onto this picture?

What happens, if you click onto → RESET ← (zurücksetzen) ?
What should happen when you select → ALL ← (Alle) ?
Should’t they have the same function ?
Isn’t RESET not the same, like showing all RESULTS ?
What do you think ?
By the way → no need for any paying → first time always → FREE 
→ you got an e-mail.