Skip to content

Commit

Permalink
Merge pull request #34 from deecay/drilldown
Browse files Browse the repository at this point in the history
Drilldown, for Redmine > 3.3.0
  • Loading branch information
deecay committed Dec 27, 2016
2 parents a31d41c + b9f7dbb commit 74802c5
Show file tree
Hide file tree
Showing 65 changed files with 528 additions and 422 deletions.
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,14 @@ It uses [PivotTable.js](http://nicolas.kruchten.com/pivottable/examples/) as a u

With this plugin you can:
* Analyze issues and activities by pivot tables and graphs
* Drag and drop attributes to dynamiccaly change rows/columns configuration
* Drag and drop attributes to dynamically change rows/columns configuration
* Drilldown to issues by clicking on table cells
* Save your configuration as queries

![Image](https://raw.github.com/wiki/deecay/redmine_pivot_table/images/table_simple.jpg)

Requieres IE8 and above.
PivotTable.js version included: May 20, 2016
PivotTable.js version included: Dec 26, 2016


## Installation
Expand Down Expand Up @@ -60,8 +61,7 @@ For aggregator and renderer names, consult pivot.pt.js and send pull request to

## Todo

* Add "edit pivot query".
* Some clean-ups of code and locale after recent changes.
* Add proper "save/edit/delete pivot query".


## Keywords
Expand Down
20 changes: 14 additions & 6 deletions app/views/pivottables/index.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,11 @@ $(document).ready(function(){
rendererOptions: {
c3: {
size: { width: window.innerWidth / 1.4 * 0.8 }
},
table: {
<% if (@table != "activity") && (Redmine::VERSION.to_s >= "3.3.0") %>
clickCallback: drill_through
<% end %>
}
},

Expand Down Expand Up @@ -155,6 +160,8 @@ function clear_attr(){
data,
{
renderers: renderers,
rendererOptions: { c3: { size: { width: window.innerWidth / 1.4 * 0.8 } },
table: { clickCallback: drill_through } },
sorters: $.pivotUtilities.sorters,
onRefresh: update_url,
rows: [],
Expand All @@ -164,6 +171,13 @@ function clear_attr(){
true,
"<%= @language %>");
}
function drill_through(e, value, filters, pivotData){
var id_list = [];
pivotData.forEachMatchingRecord(filters,
function(record){ id_list.push(record.ID.replace(/(<([^>]+)>)/ig,"")); });
var issue_path = "<%= @project ? project_issues_path(@project) : issues_path -%>"
window.open(issue_path + "?set_filter=1&issue_id=" + id_list.join("%2C"));
}
function update_url(config){
var config_copy = JSON.parse(JSON.stringify(config));

Expand Down Expand Up @@ -202,12 +216,6 @@ function update_url(config){
});
}

$(function(){
$("td.pvtVal").click( function(){
alert($("tr").index(this));
});
});

function unescapeHTML(str) {
var div = document.createElement("div");
div.innerHTML = str.replace(/</g,"&lt;")
Expand Down
5 changes: 2 additions & 3 deletions assets/javascripts/c3_renderers.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion assets/javascripts/c3_renderers.js.map

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions assets/javascripts/c3_renderers.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion assets/javascripts/c3_renderers.min.js.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion assets/javascripts/d3_renderers.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 74802c5

Please sign in to comment.