From f92d898d1b4f12298394595a7c7df2ecd7b4bf60 Mon Sep 17 00:00:00 2001 From: Nabin Hait Date: Tue, 22 Jan 2013 14:01:40 +0530 Subject: [PATCH] export tree-grid-report with groups and ledgers selectively --- public/js/wn/views/grid_report.js | 36 +++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) diff --git a/public/js/wn/views/grid_report.js b/public/js/wn/views/grid_report.js index 2f9e61d74f..b36e582012 100644 --- a/public/js/wn/views/grid_report.js +++ b/public/js/wn/views/grid_report.js @@ -820,4 +820,40 @@ wn.views.TreeGridReport = wn.views.GridReportWithPlot.extend({ d.indent = indent; }); }, + + export: function() { + var msgbox = msgprint('

Select To Download:

\ +

With Groups

\ +

With Ledgers

\ +

'); + + 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