Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

Multiple selections in a cfgrid form

New Here ,
Apr 15, 2009 Apr 15, 2009

HeIlo, 

I have a fantasy football site for which I need to enable users to make their lineup for a given match, choosing 11 players from a 23-player roster.

To do so, I though of providing a form populated by a query, displaying data (i.e. the roster) through the cfgrid tag, then enabling users to select multiple records and assign each record a row number (i.e. a jersey number, hopefully in the same form).

Only, I can't find any option to select multiple rows from the grid. Any suggestions ?

Thanks

Giovanni

1.5K
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guest
Apr 19, 2009 Apr 19, 2009
LATEST

Hi,

Here is an approach that may work for you.

In the registration process, assign each individual a userid...  e.g. bob123.

When they log into your site, create a SESSION variable, SESSION.userid = bob123.

In your db, for every player have two fields, one is the userid of the person that is attached to that player, and another field for the jersey number.  You could also have a field for assigned/unassigned.

Populate the grid with the unassigned players.  Have the empty jersey number field on the grid and make it editable.  When an individual assigns a jersey number to the person, (you can have them update after each person selected or at the end), you can let a cfc update the db and using their SESSION.userid, they become the "owner" of that player.  The update also will update the db with their jersey number.  The update can also turn them from unassigned to assigned so noone else can "claim" them.

Now anytime the user logs in, they'll have their players, easy to get to using a WHERE sql statement = WHERE SESSION.userid = bob123.

cfwild

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Resources