optionally differentiate between option values and label when narrowing dependent values

pull/6827/head
Philipp Tessenow 14 years ago
parent 85512d81f8
commit 56b6ad3179
  1. 4
      assets/javascripts/reporting/filters.js
  2. 2
      lib/report/controller.rb

@ -287,7 +287,9 @@ Reporting.Filters = {
});
// insert new values
response.responseJSON.each(function (o) {
var value = (o === null ? "" : o);
var ary = [ (o === null ? "" : o) ].flatten();
var label = ary.first();
var value = ary.last();
// cannot use .innerhtml due to IE wierdness
$(selectBox).insert(new Element('option', {value: value}).update(value.escapeHTML()));
});

@ -117,7 +117,7 @@ module Report::Controller
:values => params[:values][dependency])
end
query.column(dependent)
values = [::I18n.t(:label_inactive)] + query.result.collect {|r| r.fields[dependent] }
values = [[::I18n.t(:label_inactive), '<<inactive>>']] + query.result.collect {|r| r.fields[dependent] }
render :json => values.to_json
end
end

Loading…
Cancel
Save