leaguevine/leaguevine-ultistats — Issue #5: View to associate models with a parent model
Author: bullale
Created: 2012-02-25 02:09:41+00:00
State: open

I am thinking about how to add a player to a team. This is very easy if we assume that each player is a child of a team and the same human on another team counts as a different player entry. However, this is not the case. So we need to be able to add players to a team by choosing from among already created players. Eventually there will be too many players to make simply listing them a useful way to do this.

One idea I have is to use a text edit box at the top of the view. The player list will be empty initially. Once the user starts typing letters into the text edit box then we will start querying the server for lists of players that match the entered text. We will have to use a debounce here to limit the API queries to 1/s or so.

This view should also have a button to create a new player in case the desired player is not in the list. This create player view should be the same view as used elsewhere but the difference here is that the temporary player model will be given the team model after it is instantiated but before it is passed to the view.