I’m using a series of drop-down lists containing ACTIVE staff in my MVC 4 application. The database tables used to populate these lists contain a flag indicating active / inactive status.
The problem is, how do I handle situations where a staff member previously assigned to a case is no longer with the company, thus made inactive, thereby not meeting the criteria (Active == true) to appear in the list?
In this situation, I want the selected staff member to appear in the list where he was previously selected but he should not be in the list for new cases.
One option would be to always bring back all of the staff and when you create your select list setup all of the options to use a “data-” attribute that will contain the “Active” status flag. Then using jquery, depending on whether you are in edit mode or create mode, you can hide or show the elements based on the value of the “data-” attribute of the option.