Skip to content
Snippets Groups Projects
Commit 1852e41c authored by John Sparger's avatar John Sparger
Browse files

Update CustomTable to display loading animation

parent 1eb2fece
No related branches found
No related tags found
2 merge requests!139Merge before release,!111Reimplement search to be more responsive
import React from 'react';
import PropTypes from 'prop-types';
import { Paper } from '@material-ui/core';
import { LinearProgress, Paper } from '@material-ui/core';
import { DataTable } from 'primereact/datatable';
import { Column } from 'primereact/column';
import 'primeicons/primeicons.css';
......@@ -10,9 +10,7 @@ import 'primeflex/primeflex.css';
import './CustomTable.css';
export function CustomTable(props) {
const {columns, rows, handleRowClick, totalCount, lazyParams, setLazyParams, columnSort, setColumnSort, rowsPerPage} = props;
//const [loading, setLoading] = useState(false);
const {columns, rows, handleRowClick, totalCount, lazyParams, setLazyParams, columnSort, setColumnSort, rowsPerPage, loading=false} = props;
const dynamicColumns = columns.map((col,i) => {
return <Column key={col.id} field={col.id} header={col.label} style={{width: col.width}} body={col.body} sortable={col.sortable}/>;
......@@ -84,6 +82,7 @@ export function CustomTable(props) {
onRowClick={(event) => handleClick(event)}
rowClassName={rowClassName}
totalRecords={totalCount}
emptyMessage={loading ? <LinearProgress /> : "No records found"}
>
{dynamicColumns}
</DataTable>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment