Hey Guys,
I´m trying to create a Ranking Table for a Football league.
the Teams listed are sorted by the amount of Points and Goals. Now i´m trying to add a ranking system but I´m lost.
I need a code that automatically numbers the items. So if a team is on 3 Place i need the repeater text element to say: “#3”
In the end it should automatically show the current position of each team depending on the sort.
Here’s how to do it:
first you’ll need a text on a repeater with the id of “#text1” (or whatever, just change it in the code)
then add an on ready for the dataset by clicking “onReady” on the Properties & Events panel . This will automatically add this on your code:
export function dataset1_ready() {
// This function was added from the Properties & Events panel. To learn more, visit http://wix.to/UcBnC-4
// Add your code for this event here:
}
export function dataset1_ready() {
// This function was added from the Properties & Events panel. To learn more, visit http://wix.to/UcBnC-4
// Add your code for this event here:
$w('#repeater1').onItemReady( ($item, itemData, index) => {
$item("#text1").text = "#" + (index +1).toString();
})
}