【问题标题】:pivottable.js Aggregatorpivottable.js 聚合器
【发布时间】:2015-07-21 13:47:50
【问题描述】:

我正在使用 pivottable.js 插件 here

pivottable.js 聚合器documentation.

我想将我的“用户”数据用作数据透视表单元格中的值。现在我正在从我的 info[] 数组访问用户数据。我目前也将其设置为“行”值。我想修改它,使“用户”成为表格单元格中的值。

function refreshTable(){

console.log("Starting Pivot Table Population");

//ajax start
$.get(
    "table.php",
    function(data){

        //loop through the data and feed to the pivotUI
        var info = [];
        for (var ii=0; ii < array.length; ii++) {
            info.push({
                Skill: array[ii][0],
                Users: array[ii][3],
                IOT: array[ii][1],
                IMT: array[ii][2],
                Level: array[ii][4]});
        }
        console.log(info);

        //pivot UI
        $('#output').show();
        $("#output").pivotUI(
            info,
            {
                rows: ["Row","Users"],
                cols: ["Col1","Col2","Col3"]
            }
        );
     }

        //end of ajax function "TYPE"
        , "json")
};

【问题讨论】:

  • 仅供参考:这个库不叫pivot.js,而是pivottable.js

标签: javascript jquery pivottable.js


【解决方案1】:
猜你喜欢
  • 2017-12-28
  • 1970-01-01
  • 1970-01-01
  • 2012-08-10
  • 1970-01-01
  • 1970-01-01
  • 2020-07-26
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多