Hello, I have a dynamic page that is built for individual sport team coaches to view their individual roster of athletes which are filtered and tagged by the Organization Name. The dynamic page is connected to the main Coaches information dataset and the remaining datasets are all connected to the players information dataset.
I also have repeaters connected to this page, showing the main roster of their athletes, and then other repeaters that show a certain stat or metric from the player like how fast each player ran and which ran the fastest so he coach can have a leaderboard too.
I am trying to filter the list of athletes using tags and filter by their graduation year. Once the graduation tag is selected the repeaters should all only show those players within that coaches organization with that selected graduation year. I have tried this on a main wix page and it works just fine, but when I try this on my dynamic page, using the same code, it does not work and displays all the athletes in the entire database from all teams instead of only showing the coach his/her unique list of athletes filtered by their organization name. It does filter by grad year, but shows all athletes from all teams. Then when you deselect the graduation year tag, the repeater then displays every athlete from all teams again but now from all graduation years. I want the repeaters to only show the coach his/her athletes all the time, not all players from other teams please.
What do I need to add to my code below to allow for the repeaters to only show the athletes associated to their own individual team name and not show all athletes from all teams?
Thank you!
$w . onReady ( function () {
$w ( '#selectionTags1' ). onChange (() => {
const selectedTag = $w ( '#selectionTags1' ). value ;
let filter = wixData . filter ();
if ( selectedTag . length > 0 ) {
filter = filter . hasSome ( "gradYear" , selectedTag );
}
$w ( '#dataset1' ). setFilter ( filter );
$w ( '#dataset2' ). setFilter ( filter );
$w ( '#dataset3' ). setFilter ( filter );
$w ( '#dataset5' ). setFilter ( filter );
$w ( '#dataset6' ). setFilter ( filter );
$w ( '#dataset7' ). setFilter ( filter );
$w ( '#dataset8' ). setFilter ( filter );
$w ( '#dataset9' ). setFilter ( filter );
$w ( '#dataset10' ). setFilter ( filter );
$w ( '#dataset11' ). setFilter ( filter );
})
});