You are viewing limited content. For full access, please sign in.

Question

Question

Want to Choose From List of Users on Specific Teams

asked on September 12, 2017 Show version history

I am trying to populate a drop-down list with members of a team so the user can choose a specific name within that team, if desired. If the field is left blank, it will go to everyone on the team and someone from that team will have to grab the task from the “Available” bucket. This would help to match the assignment to a specific person yet still allow management of the roles to drive the options available (e.g., delegation).

FYI, the "HIDDEN FIELD" items in the images will be hidden in the future. Just need to see them to ensure what I'm doing is working.

I have five disciplines: Drafting, Nuclear, QA, Structural, Thermal (ignore "Other" ... that works differently).

  1. I set up a DB view which links the tables: cf_users, teams, and team_members.
  2. I set up the Lookups, which work fine ... manually.
  3. User clicks a checkbox (Drafting and Design, for example). See image below.
  4. Based on the checkbox, the discipline team (to be hidden in future) fills in with the team name for that discipline through javascript (example: Drafting Team fills in with Drafting and Design).
  5. User clicks in the discipline field and receives a drop-down of active users within that team.

Here's my problem ... the field filled in via javascript is not recognized in the Lookup.  See "Drafting", above. I thought maybe I needed a delay, that didn't work.

Manually, this works great! I know because when I click in the discipline Team field, delete out what's there, choose the Team name again, I get the drop-down list I'm expecting and can assign to an individual!!! See "Structural", above.

Here's the javascript:

$(document).ready(function(){
//Teams Fill Based on What's Checked
  $(".dcrReviewList").change(function () { 
    if ($("input[id^=Field169-0]").is(':checked')){
      $('.draftingTeam input').val("Drafting and Design");
    }
    else{
      $('.draftingTeam input').val("");        
    }

    if ($("input[id^=Field169-1]").is(':checked')){
      $('.nuclearTeam input').val("Nuclear Analysis");
    }
    else{
      $('.nuclearTeam input').val("");        
    }

    if ($("input[id^=Field169-2]").is(':checked')){
      $('.qaTeam input').val("QA Project Support");
    }
    else{
      $('.qaTeam input').val("");        
    }

    if ($("input[id^=Field169-3]").is(':checked')){
      $('.structuralTeam input').val("Structural Analysis");
    }
    else{
      $('.structuralTeam input').val("");        
    }

    if ($("input[id^=Field169-4]").is(':checked')){
      $('.thermalTeam input').val("Thermal Analysis");
    }
    else{
    $('.thermalTeam input').val("");
    }
  });
});  //close document.ready

Maybe someone has a better solution/design? If so, please share.

0 0

Answer

SELECTED ANSWER
replied on September 12, 2017 Show version history

Hey,

Try adding .change() to the end of each value assignment. And let me know how that goes.

For example:

$('.draftingTeam input').val("Drafting and Design").change();

 

0 0
replied on September 13, 2017

Thank you so much! It worked!!!!

0 0

Replies

You are not allowed to reply in this post.
You are not allowed to follow up in this post.

Sign in to reply to this post.