-
Notifications
You must be signed in to change notification settings - Fork 306
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add ability to sort items on a Spinner widget #2405
Comments
How are these being sorted for display now? If it's by an internal ID, is there a way we can control that for now (e.g. based on creation order) that can serve as a temporary work around? |
So the sorting ability should be added here on the file val answerOptionList =
this.questionnaireViewItem.enabledAnswerOptions
.map {
DropDownAnswerOption(
it.value.identifierString(context),
it.value.displayString(context),
it.itemAnswerOptionImage(context),
)
}
.toMutableList()
answerOptionList.add(
0,
DropDownAnswerOption(
context.getString(R.string.hyphen),
context.getString(R.string.hyphen),
null,
),
) |
Closing with the same rationale as #2410. @f-odhiambo if you still need this please reopen and add rationale. |
@f-odhiambo @pld just for your context - I commented in the other issue that sorting is not a behaviour well defined in the spec. I think we should respect whatever order that is provide after answer options have been resolved. we can however, define a custom extension and publish it if it's indeed what we need. please feel free to reopen if that's what you want to do. |
sorry missed this - we don't change the order at all, so if the locations are in a value set this would just be the order of the values in the valueset. |
Use case:
The spinner widget picks the data from the database and then filters it into the dropdown items (in our case locations) using fhir-path expression - Dynamic answerExpression. The implementation for this was done here #2052. POst QA we have a requirement to view the listed items in an alphabetical order (a-z)/asc/desc or by ID
Requirement
Add the ability to sort items on a Spinner widget based on defined criteria
Sample Screenshots





The text was updated successfully, but these errors were encountered: