Actions
Feature #19958
openSort search filters and options
Status:
New
Priority:
Normal
Assignee:
-
Category:
Issues
Target version:
-
Start date:
Due date:
% Done:
0%
Estimated time:
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.
Files
Updated by Toshi MARUYAMA over 9 years ago
- Tracker changed from Defect to Feature
- Category set to Issues
Updated by Thomas Löber almost 2 years ago
- File view-sort-ascending.png 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; }
Actions