Hi @NigelGee.
Yes, I'm using enums for the two menus. A highly simplified version of what I'm trying would be this:
I have a database with several different types of records:
RecordTypeA
RecordTypeB
// etc
My Sorting
enum always acts on an array of RecordTypeA
to present that array in various different ways. It presents ONLY RecordTypeA
.
My Filtering
enum may present a filtered list of RecordTypeA
objects, or it may present a list of RecordTypeB
, or some other record type.
If Sorting
only presents a list of RecordTypeA
and the user selects a filtering option that returns a list of RecordTypeB
, obviously those two selections are nonsensical together.
So if:
Sorting = RecordTypeAInAscendingOrder
Filtering = RecordTypeAFilteredBySomeCriteria
Those two options work well together. You would get the database of RecordTypeA
items filtered so that the only ones shown are those that match the filter criteria, and presented in ascending order.
However:
Sorting = RecordTypeAInAscendingOrder
Filtering = RecordTypeBFilteredBySomeCriteria
Clearly those options DO NOT work together. And also, the filtering criteria for RecordTypeB
is specific enough that the return shouldn't have enough matches to require sorting.
And, in fact, in this case the interface would mislead the user, because the Sorting
menu would still have AscendingOrder
checked, but the (short) list being presented would not, in fact, be sorted, because sorting only works on lists of RecordTypeA
and what is being presented is RecordTypeB
.
So it would be best to disable Sorting
options when the Filtering
option is going to return a list of items that aren't RecordTypeA
, and vice-versa, if appropriate.
@TheTwoNotes: I had created a method on each of the enums which used the other enum as a parameter and returned true/false if the combination worked or didn't work (which is shown in the code above), but the problem is that the .disabled()
modifier in the interface code (above) doesn't actually seem to be DOING anything. Which I'm sure means I'm using it incorrectly, but I don't understand how.