React UI Components Documentation
ReactJS Pivot Grid Component
The Pivot Grid component for React is a lightweight and powerful data visualization widget.
It allows visualization of multi-dimensional and hierarchical data structures.
It also ships with a Pivot Table Designer widget. The Pivot Table Designer allows you to visually configure the pivot columns, rows, aggregated values and multiple different settings.
You can also configure pivot rows and columns text alignment settings and various text formatting options on the pivot cells.
Before you start with the Pivot Grid widget, you should be familiar with pivot tables and understand when to use regular data grids to display table data,
and when to switch to the pivot grid and pivot tables. The following article is a good entry-level introduction to pivot tables: Wikipedia: Pivot table
Prerequisites
Refer to ReactJS Getting Started before you start with this help topic.
Configuration
The Pivot Grid component for ReactJS requires the following imports.
import React from 'react';import ReactDOM from 'react-dom'; import JqxPivotGrid from 'jqwidgets-react/react_jqxpivotgrid.js';
Then we create our component class. Properties and methods are put as ReactJS props.
Finally we render our class in the desired HTML element:
Events Methods & Properties
In order to bind to any event, change any property or call any method, we need a reference to the widget.
For that we use the ReactJS "ref" Callback Attribute:
Now, when we have a reference, we need to call the desired event/property/method.
This is done in the componentDidMount() ReactJS Component Lifecycle method.
Events
The following example demonstrates how to add an event listener:
Methods & Properties
This is how you call methods & props:
Every component have a method setOptions which accepts a object as an argument.
This object contains component settings.
Every component also have a method getOptions which returns a object containing the component settings.