We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Looks like the option labels are sorted alphabetically.
formex_ecto/lib/custom_fields/select_assoc.ex
Line 290 in aa8a6ef
How do I sort by a column?
** Context I have a multi level/nested set of categories. These can be selected at any level using a SelectAssoc field.
SelectAssoc
Data
Deserts -- Gluten Free -- Vegetarian Mains -- Chicken
Form
|> add( :categories, SelectAssoc, label: "Categories", choice_label: fn category -> if category.parent_id do "-- #{category.name}" else category.name end end, query: fn query -> from c in query, order_by: [asc: :sort_value] end, validation: [:required] )
However, it displays like this:
-- Gluten Free -- Vegetarian -- Chicken Deserts Mains
The text was updated successfully, but these errors were encountered:
Maybe you can make use of group_by option? Anyway, custom sorting in selects is the must have in this library
group_by
Sorry, something went wrong.
I did not need many to many relation, thus I could replace it with a simple select field with choices.
No branches or pull requests
Looks like the option labels are sorted alphabetically.
formex_ecto/lib/custom_fields/select_assoc.ex
Line 290 in aa8a6ef
How do I sort by a column?
** Context
I have a multi level/nested set of categories. These can be selected at any level using a
SelectAssoc
field.Data
Form
However, it displays like this:
The text was updated successfully, but these errors were encountered: