0
我想在數據透視Table.I已使用pivotTable.js創建數據透視表的功能。使用nrecopivot.js,嘗試排序,但我得到ReferenceError:NReco數據透視表擴展未定義。 有什麼幫助嗎? 我正在使用此代碼創建數據透視表。ReferenceError:NReco數據透視表擴展沒有被定義
var nrecoPivotExt = new NRecoPivotTableExtensions({
drillDownHandler: function (dataFilter) {
var filterParts = [];
for (var k in dataFilter) {
filterParts.push(k+"="+dataFilter[k]);
}
}
});
var stdRendererNames = ["Table","Table Barchart","Heatmap","Row Heatmap","Col Heatmap"];
var wrappedRenderers = $.extend({}, $.pivotUtilities.renderers);
$.each(stdRendererNames, function() {
var rName = this;
wrappedRenderers[rName] = nrecoPivotExt.wrapTableRenderer(wrappedRenderers[rName]);
});
var pivotRepName = "pivotData.csv";
var derivers = $.pivotUtilities.derivers;
$.get(pivotRepName , function(mps) {
$("#Result").pivotUI($.csv.toArrays(mps), {
renderers: $.extend(
$.pivotUtilities.renderers,
$.pivotUtilities.gchart_renderers,
$.pivotUtilities.d3_renderers,
$.pivotUtilities.export_renderers
),
renderers: wrappedRenderers,
rendererOptions: { sort: { direction : "desc", column_key : [ 2014 ]} },
rendererName: "Table",
});
});