Hey there guys
I am trying to figure out what is the best way to create a "join" dataset
Generally speaking I have two datasets - one is reflecting a players table - for simplicity it has only 2 fields name and country, and a second data set "games" which needs to holds 2 players and a result of the game
My final aim is to represent this in a tournament chart like this
now there are 2 main questions here:
1. How should I "join" the players database and the games data base - There isn't a real "logic key" in the wix code system apart from the hidden "id" column - Should I use it? i.e. - should the automatically generated id on the players table could be inserted into the "game" database as player no1, or player no 2 (alternatively I can manage my own "player id" - but this is much less elegant - because there is not prevention of somebody entering the DB 2 players with the same player id. and I'll need to build a code to prevent this
2. More complicated - lets assume I have 4 games in a first round of a tournament ,and I have created 4 games in my "games" database (or collection to use your terminology)
on the presentation I want to create 4 games exactly as below but instead a link - I want to have buttons (the aim is that a site user will try to predict the winner of the game by clicking the button)
I guess that a dynamic button creation (i.e. - querying the DB - understanding how much games are there and then create 2 buttons for each one ) is not wix style (I might be wrong here)
Lets assume I have created 8 buttons for the 4 games - what is the best path to bind the players data into them?
Naturally I don't want the code the query for each button the players data with player id.
The 2 "wix - native" structure - of either creating an item page or creating a gallery does not apply here ( I want all 4 games one after another (or maybe I am wrong and gallery is a possible path))
Should I write a module that retrieves a duo - player id, player name and than bind them to the buttons somehow?
Once again - feel free to say that you don't have the time - and I will seek help in the forums...