Changeset 624 in tmcsimulator for branches/LCSv2/controllers/default.py


Ignore:
Timestamp:
08/29/2020 09:03:00 AM (6 years ago)
Author:
jdalbey
Message:

LCS dynamically fill fieldrep from selected supervisor

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/LCSv2/controllers/default.py

    r623 r624  
    214214        supervisors.append(row.radiocallnum + ' ' + row.name) 
    215215    crew = ['']  # List of names for the dropdown box 
     216    crewlookup = [] 
    216217    # Obtain all the crew names from the database 
    217218    for row in db().select(db.crew.ALL): 
    218219        crew.append(row.radiocallnum + ' ' + row.name) 
     220        crewlookup.append(row.radiocallnum + ' ' + row.name) 
    219221    # Build the list of street locations and a hidden cross street lookup table 
    220222    streets = [''] 
     
    263265            TD(LABEL('Field Rep')) 
    264266            ),  
    265           TR(TD(SELECT(supervisors,_name='supervisor', requires=IS_LENGTH(minsize=1,error_message='supervisor cannot be empty'))), 
    266              TD(SELECT(crew,_name='fieldrep')), 
     267          TR(TD(SELECT(supervisors,_name='supervisor', _id='supervisorcombo', _onchange='supervisorchanged()', requires=IS_LENGTH(minsize=1,error_message='supervisor cannot be empty'))), 
     268             TD(SELECT(crew,_name='fieldrep',_id='fieldrep')), 
    267269             TD(XML("    ")), 
    268270             TD('Is this an existing incident?', 
     
    279281                  TR(TD(INPUT(_name='meeting', _size='25')),TD(INPUT(_name='reason',_size='25')),TD(INPUT(_name='remarks',_size='25'))) ), BR(),  
    280282            INPUT(_type='submit',_value='Submit Closure', _class="btn btn-primary btn-default", _style="margin:  2% 45% 2% 40%;"), 
    281             XML('\n'),SELECT(streetlookup,_name='stlookup', _id='stlookup', _class='hideme'))  
     283            XML('\n'),SELECT(streetlookup,_name='stlookup', _id='stlookup', _class='hideme'),  
     284SELECT(crewlookup,_name='crewlookup', _id='crewlookup', _class='hideme'))  
    282285 
    283286    if form.process(onvalidation=validate_existing_id).accepted: 
Note: See TracChangeset for help on using the changeset viewer.