Feature #19958
Sort search filters and options
Status: | New | Start date: | ||
---|---|---|---|---|
Priority: | Normal | Due date: | ||
Assignee: | - | % Done: | 0% | |
Category: | Issues | |||
Target version: | - | |||
Resolution: |
Description
Sorting search filters and search options will help to find quickly what u r looking for.
Patching the following method add the requested sort:
- filters_options_for_select
- query_available_inline_columns_options
- query_selected_inline_columns_options
But will be nice if it's in the next release.
History
#1
Updated by Toshi MARUYAMA over 7 years ago
- Tracker changed from Defect to Feature
- Category set to Issues
#2
Updated by Gianni Cavallotto 2 months ago
+1
#3
Updated by Thomas Löber 18 days ago
- File view-sort-ascending.png added
I'd rather place a small icon next to the drop-down lists to be able to sort the lists on demand.
layouts/base.html.erb:
<script> $('#query-form, #query_form').find('select').filter('#available_c, #group_by, #query_group_by, #add_filter_select, [id^="query_sort_criteria_attribute_"]').before('<%= j link_to_function image_tag('view-sort-ascending.png'), 'sortButtonClicked(this)', class: 'sort-button-link', title: l(:button_sort) %>') </script>
application.js:
function sortButtonClicked(button) { const select = $(button).hide().siblings('select').first() select.find('option').sort((x, y) => $(x).text().localeCompare($(y).text())).appendTo(select) select.children('optgroup').remove() select.val('') }
application.css:
.sort-button-link { padding-left: 4px; padding-right: 4px; vertical-align: middle; } .sort-button-link img { height: 12px; } .query-columns .sort-button-link { float: right; }