jquery-bracket icon indicating copy to clipboard operation
jquery-bracket copied to clipboard

Custom Team Ids

Open darkcode85 opened this issue 8 years ago • 2 comments

As far I can see the data-teamid are generated using an index sequence, would be possible to pass the team id from the backend? It will help to then save the correct id values in the database an correctly show the winners of the event in other views.

What I'm doing now is to save the winners using the team names but it could cause errors if two teams has the same name (which is possible in my system), so what is the best way to save the winners of the event using IDs from the backend?

Thanks for this great library!

darkcode85 avatar Oct 31 '17 17:10 darkcode85

Hi @teijo, any possible update here?

darkcode85 avatar Nov 03 '17 04:11 darkcode85

Hi, would the data customization support your needs: http://www.aropupu.fi/bracket/#customHandlers

Instead of using:

teams : [
    ["Team 1", "Team 2"],
    ...
  ]

You could use the following to pass custom data:

teams : [
    [{name: "Team 1", backendId: 213}, {name: "Team 2", backendId: 36}],
    ...
  ]

teijo avatar Nov 04 '17 16:11 teijo