简体   繁体   中英

pivottable.js Aggregator

I'm using the pivottable.js plugin here .

pivottable.js aggregator documentation .

I want to to use my data for "Users" as the value in the pivot table cells. Right now I am accessing user data from my info[] array. I also have it set as a "row" value currently. I want to modify this so that "Users" will be my VALUE in the cells of the table.

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")
};

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM