select values on filters loading values remotely

pull/6827/head
Jens Ulferts 8 years ago
parent e431cd9a3a
commit 058ff459d5
No known key found for this signature in database
GPG Key ID: 3CAA4B1182CF5308
  1. 1
      lib/widget/filters/heavy.rb
  2. 1
      lib/widget/filters/multi_values.rb

@ -33,6 +33,7 @@ class Widget::Filters::Heavy < Widget::Filters::Base
opts = Array(values).empty? ? [] : values.map { |i| filter_class.label_for_value(i.to_i) }
div = content_tag :div, id: "#{filter_class.underscore_name}_arg_1", class: 'advanced-filters--filter-value hidden' do
select_options = { :"data-remote-url" => url_for(action: 'available_values'),
:"data-initially-selected" => JSON::dump(Array(filter.values).flatten),
name: "values[#{filter_class.underscore_name}][]",
:"data-loading" => '',
id: "#{filter_class.underscore_name}_arg_1_val",

@ -24,6 +24,7 @@ class Widget::Filters::MultiValues < Widget::Filters::Base
def render
write(content_tag(:div, id: "#{filter_class.underscore_name}_arg_1", class: 'advanced-filters--filter-value') do
select_options = { :"data-remote-url" => url_for(action: 'available_values'),
:"data-initially-selected" => JSON::dump(Array(filter.values).flatten),
style: 'vertical-align: top;', # FIXME: Do CSS
name: "values[#{filter_class.underscore_name}][]",
:"data-loading" => @options[:lazy] ? 'ajax' : '',

Loading…
Cancel
Save