add callback

git-svn-id: https://dev.finn.de/svn/cockpit/branches/reporting_merge@1333 7926756e-e54e-46e6-9721-ed318f58905e
pull/6827/head
t.felgentreff 15 years ago
parent 361776cbbd
commit 03b2e9469c
  1. 6
      app/views/cost_reports/_filters.rhtml
  2. 2
      app/views/cost_reports/index.rhtml

@ -8,7 +8,7 @@
<% active_filters = query.filters.select {|f| f.class.display?} %> <% active_filters = query.filters.select {|f| f.class.display?} %>
<script type="text/javascript"> <script type="text/javascript">
//<![CDATA[ //<![CDATA[
document.observe("dom:loaded", function() { function set_filters() {
// Activate recent filters on loading // Activate recent filters on loading
<% active_filters.each do |f| %> <% active_filters.each do |f| %>
show_filter("<%= f.class.underscore_name %>"); show_filter("<%= f.class.underscore_name %>");
@ -17,7 +17,9 @@ document.observe("dom:loaded", function() {
toggle_multi_select("<%= f.class.underscore_name %>"); toggle_multi_select("<%= f.class.underscore_name %>");
<% end %> <% end %>
<% end %> <% end %>
}); }
document.observe("dom:loaded", set_filters());
//]]> //]]>
</script> </script>

@ -20,12 +20,14 @@
<p class="buttons"> <p class="buttons">
<%= link_to_remote l(:button_apply), <%= link_to_remote l(:button_apply),
{ :url => { :set_filter => 1 }, { :url => { :set_filter => 1 },
:complete => "set_filters()"
:update => "content", :update => "content",
:with => "Form.serialize('query_form')" :with => "Form.serialize('query_form')"
}, :class => 'icon icon-checked' %> }, :class => 'icon icon-checked' %>
<%= link_to_remote l(:button_clear), <%= link_to_remote l(:button_clear),
{ :url => { :set_filter => 1 }, { :url => { :set_filter => 1 },
:complete => "set_filters()"
:update => "content", :update => "content",
}, :class => 'icon icon-reload' %> }, :class => 'icon icon-reload' %>
<% if User.current.allowed_to?(:save_queries, @project, :global => true) %> <% if User.current.allowed_to?(:save_queries, @project, :global => true) %>

Loading…
Cancel
Save