Quick-start React project demonstrating local and remote data binding to Syncfusion's powerful PivotTable component with TypeScript support β includes practical JSON binding examples, remote data source integration patterns, and production-ready component configuration.
This repository provides a comprehensive, production-ready example for implementing data binding in React Pivot Table components using Syncfusion's EJ2 library. Whether you're building business intelligence dashboards, financial reporting tools, or data analytics applications, this project demonstrates modern React best practices for dynamic data visualization.
- β Local Data Binding: Bind JSON data directly to pivot table components
- β Remote Data Binding: Connect to external API data sources with dynamic loading
- β Syncfusion EJ2 Library: Leverages feature-rich React components from Syncfusion
- β TypeScript Support: Full type-safe development with modern React patterns
- β Responsive Design: Optimized for desktop and tablet viewports
- β Production Ready: Configured with best practices and clean code structure
- β Quick Start Setup: Easy-to-follow configuration with zero-config execution
- Node.js: LTS v18 or higher β Download
- npm: v9 or higher (included with Node.js)
- React: v18 or higher
- TypeScript: v5 or higher
- Visual Studio Code: Latest stable version (recommended)
git clone https://github.com/SyncfusionExamples/data-binding-in-react-pivot-table-component.git
cd data-binding-in-react-pivot-table-componentnpm installnpm startThe application will automatically open at http://localhost:3000.
Bind JSON data directly to your pivot table:
import { PivotViewComponent, Inject, PivotFieldList } from '@syncfusion/ej2-react-pivotview';
const data = [
{ ProductID: 1, ProductName: 'Laptop', Amount: 5000, Region: 'North' },
{ ProductID: 2, ProductName: 'Desktop', Amount: 3500, Region: 'South' }
];
export function LocalDataBinding() {
return (
<PivotViewComponent dataSource={data} height="400">
<Inject services={[PivotFieldList]} />
</PivotViewComponent>
);
}Connect to external data sources:
const dataSource = {
url: 'https://api.example.com/data',
adaptor: new JsonAdaptor()
};
<PivotViewComponent dataSource={dataSource} height="400">
<Inject services={[PivotFieldList]} />
</PivotViewComponent>data-binding-in-react-pivot-table-component/
βββ src/
β βββ App.tsx # Main application component
β βββ App.css # Application styles
β βββ App.test.tsx # Component tests
β βββ index.tsx # React entry point
β βββ index.css # Global styles
β βββ csvdata.ts # Sample CSV data
β βββ data.js # Sample JSON data
β βββ reportWebVitals.ts # Performance metrics
βββ public/
β βββ index.html # HTML template
β βββ manifest.json # PWA manifest
β βββ robots.txt # SEO robots file
βββ package.json # Dependencies and scripts
βββ tsconfig.json # TypeScript configuration
βββ README.md # This file
The project includes comprehensive examples for both local and remote data binding patterns. Explore the component implementations to understand:
- How to structure pivot table configurations
- Binding data from JSON sources
- Connecting to REST APIs
- Handling dynamic data updates
- Configuring rows, columns, and values
- csvdata.ts: Pre-configured CSV data for pivot table examples
- data.js: JSON formatted sample data for local binding demonstrations
npm startβ Start the development servernpm testβ Run test suitenpm run buildβ Build production bundlenpm run ejectβ Eject Create React App (not reversible)
Configure data sources and API endpoints in your component files:
const API_BASE_URL = process.env.REACT_APP_API_URL || 'http://localhost:5000';
const DATA_SOURCE_URL = `${API_BASE_URL}/api/data`;Port already in use?
npm start -- --port 3001Syncfusion license key issues? Check Syncfusion documentation for registration: https://www.syncfusion.com/products/react
Data not displaying? Verify data structure matches expected schema and check browser console for errors.
Contributions are welcome! Please read our contributing guidelines and submit pull requests to our repository.
This project is licensed under the Syncfusion Community License. See Syncfusion License for details.
- Syncfusion React Documentation
- React Official Documentation
- TypeScript Handbook
- Pivot Table Component Guide
For issues, questions, or suggestions:
- π§ Open an issue on GitHub
- π¬ Check existing documentation
- π Visit Syncfusion support forums