diff options
| author | Gery Debongnie <ged@openerp.com> | 2013-11-25 10:04:43 +0100 |
|---|---|---|
| committer | Gery Debongnie <ged@openerp.com> | 2013-11-25 10:04:43 +0100 |
| commit | 7940ec40c65214a2bdcd800a1dd2291980abc25b (patch) | |
| tree | 64cc2b5c9667b6fee912db580bc58f48b644d10f /addons/web_graph/static/src/js/graph.js | |
| parent | 86a2d41d24045e1ba020199c998d315a5c8d9b10 (diff) | |
[IMP] add total to each rows in pivot table view (addon web_graph)
bzr revid: ged@openerp.com-20131125090443-r5dbre9wn2jymu37
Diffstat (limited to 'addons/web_graph/static/src/js/graph.js')
| -rw-r--r-- | addons/web_graph/static/src/js/graph.js | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/addons/web_graph/static/src/js/graph.js b/addons/web_graph/static/src/js/graph.js index 0a6a2fd15db..69155e7b255 100644 --- a/addons/web_graph/static/src/js/graph.js +++ b/addons/web_graph/static/src/js/graph.js @@ -284,6 +284,7 @@ instance.web_graph.GraphView = instance.web.View.extend({ make_cells(pivot.cols.headers, 0); } else { make_cells(pivot.cols.main.children, 1); + header_cells[0].push(self.make_border_cell(1, height).append('Total')); } _.each(header_cells, function (cells) { @@ -322,6 +323,16 @@ instance.web_graph.GraphView = instance.web.View.extend({ html_row.append(cell); } }); + var cell = $('<td></td>').append(pivot.get_value(row.id,pivot.cols.main.id)); + if (row.is_expanded && (row.path.length <= 2)) { + var color = row.path.length * 5 + 240; + cell.css("background-color", "rgb(" + [color, color, color].join() + ")"); + } + + if (pivot.cols.main.children.length > 0) { + html_row.append(cell); + } + this.table.append(html_row); } }); |
