Skip to content
Discussion options

You must be logged in to vote

This can be done is an easier way (without jQuery) by dynamically adding a column. An example of this is shown in RowSelect where a new column in added to show checkboxes.
I forked your code here, https://codesandbox.io/s/react-table-checkin-checkout-uks4x.

Essentially update your useTable() to

const {
    ...
  } = useTable(
    {
      columns,
      data,
      updateMyData
    },
    usePagination,
    hooks => {
      hooks.visibleColumns.push(columns => [        
        {
          id: "checkinout",
          Header: "CheckIn/Out",
          Cell: ({ row }) => <CheckButton {...row} />
        },
        ...columns
      ]);
    }
  );

and provide a custom Button component. For eg,

c…

Replies: 1 comment 5 replies

Comment options

You must be logged in to vote
5 replies
@umarmuha
Comment options

@GuptaSiddhant
Comment options

@umarmuha
Comment options

@t0scale
Comment options

@GuptaSiddhant
Comment options

Answer selected by umarmuha
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
3 participants