top of page

WIX Resources Table
Title | Description | URL (text) | CodeExample |
|---|---|---|---|
Newst Title x | dew new | URL new | |
test 1 | Must-Have Velo Glossary for Coders: 60+ Essential Terms Precisely Explained by
| https://hackernoon.com/must-have-velo-glossary-for-coders-60-essential-terms-precisely-explained-8x1n33rn | |
If Else commands with Tables Datasets | Using the Unfiltered Dataset outside the Repeater
When you select the dataset which the repeater itself is connected to using a global scope selector, you are selecting a regular dataset. That regular dataset controls the number and order of the repeater items and any elements connected to it that are not contained in repeater items. The elements inside repeater items are not affected even though they are connected to the same dataset.
For example, let's say we had a button outside the repeater shown above. We could use it to sort the items in the repeater by calling the dataset setSort() function in the button's onClick event handler. Nothing would happen to any of the elements inside the repeated items, but the items themselves would be sorted. | import wixData from 'wix-data';
$w.onReady( () => {
$w("repeaterSort").onClick( (event) => {
if(event.target.label === "A-Z"){
$w("#bandsDataset").setSort(wixData.sort().ascending("name"));
event.target.label = "Z-A";
}
else {
$w("#bandsDataset").setSort(wixData.sort().descending("name"));
event.target.label = "A-Z";
}
} );
} ); | |
Test F | Descr FF | URL F | |
Test B | |||
test A | der B | URL B | |
test 10 | |||
test 9 | |||
test 8 | description 9 | url 9 | |
test 5 | |||
test 4 | |||
test 2 |
bottom of page