https://github.com/t2wain/tan-datatable
React component for the DataTable.net
https://github.com/t2wain/tan-datatable
datatable-net typescript-react
Last synced: about 1 year ago
JSON representation
React component for the DataTable.net
- Host: GitHub
- URL: https://github.com/t2wain/tan-datatable
- Owner: t2wain
- Created: 2023-09-21T23:07:33.000Z (over 2 years ago)
- Default Branch: master
- Last Pushed: 2023-09-26T11:31:03.000Z (over 2 years ago)
- Last Synced: 2025-02-12T02:02:31.034Z (over 1 year ago)
- Topics: datatable-net, typescript-react
- Language: TypeScript
- Homepage: https://t2wain.github.io/tan-datatable/
- Size: 1.96 MB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
## Introduction
This is a sample DataTable.net React component to display data in a table. This is a feature extracted from an application I developed. I have also refactored the code so that it can be reused more easily. The basic usage is follow:
```JSX
```
- tblData - an array of json objects. Note, the table will be updated when data changed.
- colDefs - an array of column config per DataTable.net. Note, if the column has a css class *.select-filter*, a dropdown filter will be setup for that column.
- order - an array of default sort columns per DataTable.net
All the code calling the DataTable.net api is extracted to a separate module since it is manipulating the DOM outside of React.
## React Custom Hook
The custom hook *useData* can assist with making an async method call (such as to retrieve data) while providing a loading status and a display message.