TEST-FILTER
Title | Index | Kategorie | Tutorial | Level | Beschreibung |
|---|---|---|---|---|---|
AVATAR-GENERATOR | 00016 | DROP-DOWN | EXPERIENCED | Description | |
Page-Redirection | 00015 | NAVIGATION | EXPERIENCED | Description... | |
Multistate-Boxes | 00014 | Multistate-Boxes | BEGINNER | Description... | |
Wix-Registration-Page | 00013 | REGISTRATION | EXPERIENCED | Description... | |
User-Infos | 00012 | LOG-IN | EXPERIENCED | Description... | |
Random Numbers & Strings | 00011 | NUMBER & STRING | EXPERIENCED | Description... | |
Switch Safe-Function | 00010 | FUNCTION (Button) | EXPERIENCED | Description... | |
Enable-Button (checked) | 00009 | CHECKBOX & BUTTON | BEGINNER | Description... | |
Triggered-Email | 00008 | E-MAIL | ADVANCED | Description... | |
Get current row in table | 00007 | TABLE | BEGINNER | Description... | |
Color-Panel | 00006 | CUSTOM | EXPERIENCED | Description... | |
parseFloat-Function | 00005 | FUNCTION (Numbers) | BEGINNER | Description... |
CODE
import wixData from 'wix-data';
$w.onReady( () => {
$w("#dataset1").onReady( () => {
let totalCount = $w("#dataset1").getTotalCount()
$w("#dataset1").getItems(0, totalCount)
.then( (result) => {
let items = result.items;
//------------------------------------------
console.log("Total-Count = " + totalCount)
console.log((totalCount))
console.log(items)
console.log(items[0].index)
console.log(items[0].kategorie)
console.log(items[0].tutorialLevel)
//------------------------------------------
} );
} );
} );
export function BTNfilterresults_click(event) {show_results(), $w('#BOXfilterresults').show('FadeIn')}
function show_results (parameter) {
$w("#dataset1").onReady( () => {
$w("#dataset1").getItems(0, $w("#dataset1").getTotalCount())
.then( (result) => {
let items = result.items
let totalCount = result.items.length
let firstFilteredItem = items[0]
let lastFilteredItem = items[totalCount-1]
console.log(result)
console.log(totalCount)
console.log(firstFilteredItem)
console.log(lastFilteredItem)
$w('#TXTtotalcount').text = totalCount.toString()
$w('#TXTfirstitem').text = firstFilteredItem.title.toString()
$w('#TXTlastitem').text = lastFilteredItem.title.toString()
})
})
}
export function BTNfilter_click(event) {start_Filter()}
function start_Filter (parameter) {
$w('#repeater1').show()
let filter = wixData.filter()
let myKategory = $w('#dropdown1').value
let myTutorial = $w('#dropdown2').value
if ($w('#dropdown1').value!=0) {filter = filter.contains('kategorie', myKategory);}
if ($w('#dropdown2').value!=0) {filter = filter.eq('tutorialLevel', myTutorial);}
console.log(filter)
$w('#dataset1').setFilter(filter)
}












