dorj-json-data-grid
v1.2.3
Published
A React component for displaying JSON data in a grid format
Downloads
9
Readme
dorj-json-data-grid
A React component for displaying JSON data in a grid format.
Features
- Display and edit JSON data in a user-friendly grid
- Integrates with
dorj-data-grid - Supports custom API hooks for data operations
- Compatible with React 16.x and above
Installation
npm install dorj-json-data-gridPeer Dependencies
Make sure you have react (>=16.x) installed in your project.
Usage
import React from 'react';
import JsonDataGrid from 'dorj-json-data-grid';
const data = [
{ id: 1, name: 'John', age: 30 },
{ id: 2, name: 'Jane', age: 25 }
];
function handleChange(updatedData) {
console.log('Updated data:', updatedData);
}
function App() {
return (
<JsonDataGrid
value={data}
onChange={handleChange}
options={{ /* grid options */ }}
/>
);
}
export default App;Props
| Prop | Type | Description | |-----------|----------|--------------------------------------------------| | value | array or JSON string | The data to display in the grid | | onChange | function | Callback when data is changed | | options | object | Options to pass to the underlying data grid | | hub | any | Optional hub prop for advanced integrations | | api | object | Optional custom API methods |
Development
To build the project:
npm run buildTo start development mode:
npm run devLicense
MIT
