Skip to content

Commit

Permalink
Merge pull request #154 from ECN/enhancement-persistent-filters-and-s…
Browse files Browse the repository at this point in the history
…orting

Enhancement persistent filters and sorting
  • Loading branch information
campb303 authored Dec 16, 2020
2 parents 0fd6f0a + c20b9b8 commit 38445fe
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/components/ItemTable/ItemTable.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import { ArrowDownward, ArrowUpward } from "@material-ui/icons";
export default function ItemTable({ data, rowCanBeSelected }) {
const [selectedRow, setSelectedRow] = useState({ queue: null, number: null});

const theme = useTheme();
const theme = useTheme();
const useStyles = makeStyles({
// Fully visible for active icons
activeSortIcon: {
Expand Down Expand Up @@ -57,6 +57,8 @@ export default function ItemTable({ data, rowCanBeSelected }) {
{
columns,
data,
autoResetSortBy: false,
autoResetFilters: false,
defaultColumn: {
Filter: ({ column: { Header, setFilter } }) => {
return (
Expand All @@ -68,7 +70,7 @@ export default function ItemTable({ data, rowCanBeSelected }) {
}
},
},
useFilters, useFlexLayout, useSortBy,
useFilters, useFlexLayout, useSortBy,
);
const { getTableProps, getTableBodyProps, headerGroups, rows, prepareRow, } = tableInstance;

Expand Down Expand Up @@ -136,7 +138,7 @@ export default function ItemTable({ data, rowCanBeSelected }) {
classes={{ root: (isSelected && rowCanBeSelected) ? classes.rowSelected : classes.bandedRows }}
{...row.getRowProps()} >
{row.cells.map(cell => (
<TableCell
<TableCell
classes={{ root: classes.columnBorders }}
{...cell.getCellProps()}
>
Expand Down

0 comments on commit 38445fe

Please sign in to comment.