Skip to content

Commit

Permalink
[#33] Disable subtotals under a specified level
Browse files Browse the repository at this point in the history
  • Loading branch information
nagarajanchinnasamy committed Aug 9, 2017
1 parent 431e86d commit 5e12c30
Show file tree
Hide file tree
Showing 2 changed files with 59 additions and 0 deletions.
57 changes: 57 additions & 0 deletions examples/190_disable_after.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
<!DOCTYPE html>
<html>
<head>
<title>Subtotal Demo</title>
<!-- external libs from cdnjs -->
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/jquery/1.11.2/jquery.min.js"></script>
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/jqueryui/1.11.4/jquery-ui.min.js"></script>

<!-- PivotTable.js libs from ../dist -->
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/pivottable/2.7.0/pivot.min.js"></script>
<link rel="stylesheet" type="text/css" href="https://cdnjs.cloudflare.com/ajax/libs/pivottable/2.7.0/pivot.min.css">

<!-- subtotal.js libs from ../dist -->
<script type="text/javascript" src="../dist/subtotal.js"></script>
<link rel="stylesheet" type="text/css" href="../dist/subtotal.css">

<!-- optional: mobile support with jqueryui-touch-punch -->
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/jqueryui-touch-punch/0.2.3/jquery.ui.touch-punch.min.js"></script>

<!-- for examples only! script to show code to user -->
<script type="text/javascript" src="js/show_code.js"></script>
</head>
<body>
<script type="text/javascript">
// This example demonstrates disabling of expand collapse operations

$(function() {
var dataClass = $.pivotUtilities.SubtotalPivotData;
var renderer = $.pivotUtilities.subtotal_renderers["Table With Subtotal"];

$.getJSON("data/mps.json", function(mps) {
$("#output").pivot(mps, {
dataClass: dataClass,
rows: ["Gender", "Province"],
cols: ["Party", "Age"],
renderer: renderer,
rendererOptions: {
rowSubtotalDisplay: {
disableAfter: 0
},
colSubtotalDisplay: {
disableAfter: 0
}
}
});
});
});
</script>
<p><a href="index.html">&laquo; back to examples</a></p>
<p></p>
<p>To expand and collapse rows and columns, click on &#x25B6 and &#x25E2 arrows in the table. Scroll down to view the code.</p>
<p></p>
<div id="output" style="margin: 30px;"></div>
<p></p>
<p><a href="index.html">&laquo; back to examples</a></p>
</body>
</html>
2 changes: 2 additions & 0 deletions examples/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ <h3 align="center">Pivot Examples</h3>
<li><a href="170_hide_subtotal_on_expand.html">Hide Row and/or Column Subtotals On Expand</a></li>
<li><a href="180_disable_subtotal.html">Disable Row and/or Column Subtotals</a></li>
<li><a href="185_disable_expandcollapse.html">Disable Expand Collapse Operations</a></li>
<li><a href="190_disable_after.html">Disable Subtotal Display Afer A Specified Level</a></li>
</ul>
</div>
<div style="display: inline-block; width: 45%; min-width: 400px; max-width: 600px; vertical-align: top;">
Expand All @@ -75,6 +76,7 @@ <h3 align="center">PivotUI Examples</h3>
<li><a href="270_hide_subtotal_on_expand.html">Hide Row and/or Column Subtotals On Expand</a></li>
<li><a href="280_disable_subtotal.html">Disable Row and/or Column Subtotals</a></li>
<li><a href="285_disable_expandcollapse.html">Disable Expand Collapse Operations</a></li>
<li><a href="290_disable_after.html">Disable Subtotal Display Afer A Specified Level</a></li>
</ul>
</div>
</div>
Expand Down

0 comments on commit 5e12c30

Please sign in to comment.