-
-
Save johan--/ba02d3a12ab4ed78a1840f516fe88f55 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<style> | |
* { | |
font-family: Verdana; | |
} | |
.node { | |
border: solid 1px white; | |
font: 10px sans-serif; | |
line-height: 12px; | |
overflow: hidden; | |
position: absolute; | |
text-indent: 2px; | |
} | |
</style> | |
<section ng-controller="invoicePivot"> | |
<div class="container-fluid "> | |
<div class="row"> | |
<div id="invoicesPivotTableOutput"></div> | |
</div> | |
</div> | |
</section> | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'use strict'; | |
(function() { | |
angular.module('app').controller('invoicePivot', invoicePivot); | |
function invoicePivot($scope, $http) { | |
$scope.invoices = []; | |
getInvoices(); | |
/********************************************************* | |
* Region get data | |
*********************************************************/ | |
function getInvoices() { | |
var entity = 'Invoice'; | |
var resource = 'getInvoices'; | |
var url = 'http://' + window.location.host + '/api/' + entity + '/' + resource; | |
return $http.get(url, { cache: true }). | |
success(function (data) { | |
$scope.invoices = data; | |
pivotUi(); | |
}). | |
error(function (error) { | |
}); | |
} | |
function pivotUi() { | |
// wiki https://github.com/nicolaskruchten/pivottable/wiki/Aggregators | |
var renderers = $.extend($.pivotUtilities.renderers, $.pivotUtilities.gchart_renderers, $.pivotUtilities.d3_renderers); | |
$("#invoicesPivotTableOutput").pivotUI($scope.invoices, { | |
renderers: renderers, | |
rows: ["PrintDocNumber"], | |
cols: ["IsPrinted"], | |
rendererName: "Table" | |
}); | |
} | |
} | |
})(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment