fixing asynchronous reloading on filters

pull/6827/head
Jens Ulferts 13 years ago
parent 8bd7c663c0
commit f2f78de425
  1. 3
      assets/javascripts/reporting/filters.js
  2. 3
      lib/widget/filters/multi_values.rb

@ -8,6 +8,7 @@ Reporting.Filters = {
if (select === null || select === undefined) {
return;
}
url = select.readAttribute("remote-url");
json_post_select_values = select.readAttribute('data-initially-selected')
if (json_post_select_values !== null && json_post_select_values !== undefined) {
post_select_values = json_post_select_values.replace(/'/g, '"').evalJSON(true);
@ -17,7 +18,7 @@ Reporting.Filters = {
window.global_prefix = "";
}
new Ajax.Updater({ success: select.id }, window.global_prefix + '/reporting/available_values', {
new Ajax.Updater({ success: select.id }, url, {
parameters: {
filter_name: filter_name,
values: json_post_select_values

@ -4,7 +4,8 @@ class Widget::Filters::MultiValues < Widget::Filters::Base
def render
write(content_tag :td do
content_tag :div, :id => "#{filter_class.underscore_name}_arg_1", :class => "filter_values" do
select_options = { :style => "vertical-align: top;", # FIXME: Do CSS
select_options = { :"remote-url" => url_for(:controller => "cost_reports", :action => "available_values"),
:style => "vertical-align: top;", # FIXME: Do CSS
:name => "values[#{filter_class.underscore_name}][]",
:"data-loading" => @options[:lazy] ? "ajax" : "",
:id => "#{filter_class.underscore_name}_arg_1_val",

Loading…
Cancel
Save