refactored gii enum dropdown generator

PR #3676