Permalink
Browse files

run the report only if route changes

  • Loading branch information...
1 parent e73bedb commit c7a7413cc623bebb13f3827fcc6acc6f75e2489d @nabinhait nabinhait committed Jun 25, 2012
Showing with 5 additions and 3 deletions.
  1. +2 −0 js/legacy/widgets/report_builder/report_builder.js
  2. +3 −3 js/wn/views/reportview.js
@@ -478,6 +478,8 @@ _r.ReportBuilder.prototype.setup_filters_and_cols = function() {
_r.ReportBuilder.prototype.set_filters_from_route = function() {
// add filters from route
var route = wn.get_route();
+ //save this for checking changes in filter
+ this.current_route = wn.get_route_str();
if(route.length>3) {
for(var i=3; i<route.length; i++) {
var p = route[i].split('=');
@@ -32,11 +32,11 @@ wn.views.reportview = {
_r.rb_con.set_dt(dt, function(rb) {
if(rep_name) {
- var t = rb.current_loaded;
+ var route_changed = (rb.current_route != wn.get_route_str())
rb.load_criteria(rep_name);
- // if loaded, then run
- if((rb.dt) && (!rb.dt.has_data() || rb.current_loaded!=t)) {
+ // if loaded, then run
+ if(rb.dt && route_changed) {
rb.dt.run();
}
}

0 comments on commit c7a7413

Please sign in to comment.