Render jquery datatable inside React-pivottable Render jquery datatable inside React-pivottable database database

Render jquery datatable inside React-pivottable


I did not display all the columns, but you should be able to modify my example to include additional columns.

https://codesandbox.io/s/vibrant-haze-f9nro

enter image description here

import React, { useEffect } from "react";import PivotTable from "pivottable";import $ from "jquery";import "react-pivottable/pivottable.css";const App = () => {  useEffect(() => {    $("#output").pivot(      [        {          SRN: 108,          MainSystemType: "WA15",          MagnetCoverType: "WA_15T",          MagnetRMMUType: "Wide Aperture"        },        {          SRN: 121,          MainSystemType: "T15",          MagnetCoverType: "F2000",          MagnetRMMUType: "Achieva"        },        {          SRN: 117,          MainSystemType: "T30",          MagnetCoverType: "3T_2",          MagnetRMMUType: "Achieva AmbiRing"        }      ],      {        rows: ["SRN", "MainSystemType"],        cols: ["MagnetCoverType", "MagnetRMMUType"]      }    );  }, []);  return <div id="output" />;};export default App;