Browse Source

export tree-grid-report with groups and ledgers selectively

version-14
Nabin Hait 12 years ago
parent
commit
f92d898d1b
1 changed files with 36 additions and 0 deletions
  1. +36
    -0
      public/js/wn/views/grid_report.js

+ 36
- 0
public/js/wn/views/grid_report.js View File

@@ -820,4 +820,40 @@ wn.views.TreeGridReport = wn.views.GridReportWithPlot.extend({
d.indent = indent;
});
},
export: function() {
var msgbox = msgprint('<p>Select To Download:</p>\
<p><input type="checkbox" name="with_groups" checked> With Groups</p>\
<p><input type="checkbox" name="with_ledgers" checked> With Ledgers</p>\
<p><button class="btn btn-info">Download</button>');

var me = this;

$(msgbox.body).find("button").click(function() {
var with_groups = $(msgbox.body).find("[name='with_groups']").is(":checked");
var with_ledgers = $(msgbox.body).find("[name='with_ledgers']").is(":checked");

var data = wn.slickgrid_tools.get_view_data(me.columns, me.dataView,
function(row, item) {
if(with_groups) {
// add row
for(var i=0; i<item.indent; i++) row[0] = " " + row[0];
}
if(with_groups && (item.group_or_ledger == "Group" || item.is_group)) {
return true;
}
if(with_ledgers && (item.group_or_ledger == "Ledger" || !item.is_group)) {
return true;
}
return false;
});
wn.tools.downloadify(data, ["Report Manager", "System Manager"], me);
return false;
})

return false;
},
});

Loading…
Cancel
Save