diff --git a/src/components/ReactTable3/BasicTable.js b/src/components/ReactTable3/BasicTable.js
index 2d98395..11c5468 100644
--- a/src/components/ReactTable3/BasicTable.js
+++ b/src/components/ReactTable3/BasicTable.js
@@ -1,79 +1,118 @@
-import React, {useMemo} from 'react';
+import React, { useMemo } from "react";
-import {useTable, useSortBy, useGlobalFilter, useFilters, usePagination} from 'react-table';
+import {
+ useTable,
+ useSortBy,
+ useGlobalFilter,
+ useFilters,
+ usePagination,
+ useRowSelect,
+ useColumnOrder,
+} from "react-table";
-import {COLUMNS} from './columns';
+import { COLUMNS } from "./columns";
-import {GlobalFilter} from './GlobalFilter';
+import { GlobalFilter } from "./GlobalFilter";
-import MOCK_DATA from './MOCK_DATA.json';
-
-const BasicTable = () => {
+import { Checkbox } from "./Checkbox";
+import MOCK_DATA from "./MOCK_DATA.json";
- const columns = React.useMemo(() => COLUMNS, [])
- const data = useMemo(() => MOCK_DATA,[])
-
- const {
- getTableProps,
- getTableBodyProps,
- headerGroups,
- footerGroups,
- rows,
- page,
- nextPage,
- previousPage,
- canNextPage,
- canPreviousPage,
- pageOptions,
- gotoPage,
- pageCount,
- setPageSize,
- prepareRow,
- state,
- setGlobalFilter,
- } = useTable({
- columns,
- data,
- // initialState: { pageIndex: 2 }
+const BasicTable = () => {
+ const columns = React.useMemo(() => COLUMNS, []);
+ const data = useMemo(() => MOCK_DATA, []);
+
+ const {
+ getTableProps,
+ getTableBodyProps,
+ headerGroups,
+ footerGroups,
+ rows,
+ page,
+ nextPage,
+ previousPage,
+ canNextPage,
+ canPreviousPage,
+ pageOptions,
+ gotoPage,
+ pageCount,
+ setPageSize,
+ prepareRow,
+ selectedFlatRows,
+ state,
+ setGlobalFilter,
+ } = useTable(
+ {
+ columns,
+ data,
+ // initialState: { pageIndex: 2 }
},
- useFilters,
- useGlobalFilter,
- useSortBy,
- usePagination,
- )
-
-
- const { globalFilter, pageIndex, pageSize } = state
-
- return (
-
- <>
-
-
- {column.render('Header')}
-
- {column.isSorted ? (column.isSortedDesc ? ' 🔽' : ' 🔼') : ''}
-
- {/*
+ useFilters,
+ useGlobalFilter,
+ useSortBy,
+ usePagination,
+ useRowSelect,
+ (hooks) => {
+ hooks.visibleColumns.push((columns) => {
+ return [
+ {
+ id: "selection",
+ Header: ({ getToggleAllRowsSelectedProps }) => (
+
-
-
-
- Page{' '}
-
-
- {pageIndex + 1} of {pageOptions.length}
- {''}
-
-
-
-
-
- | Go to Page: {' '}
-
- {
- const pageNumber = e.target.value ? Number(e.target.value) - 1 : 0
- gotoPage(pageNumber)
- } }
- style={{ width: '50px' }}
- />
-
-
-
- |
---|
+
+ {JSON.stringify(
+ {
+ selectedFlatRows: selectedFlatRows.map((row) => row.original),
+ },
+ null,
+ 2
+ )}
+
+
+
+