Skip to content

Wrapping a reactabular row with an HOC/Context #360

Open

Description

@dannyhuly

Hi,
Is possible to wrap a row with a HOC or Context ?
I would like to implement a table row edit (not cell by cell edit) but i'm unable to use informed or Formik to wrap a reactabular row with a form control logic.

Is there a way to manipulate a row or is the API only allows cell manipulation ?

Any ideas ?
Thanks.

Activity

  1. changed the title [-]Wrapping table a row with an HOC/Context[/-] [+]Wrapping a reactabular row with an HOC/Context[/+] on Oct 15, 2018
  2. bebraw commented on Oct 17, 2018

    @bebraw
    Member

    Did you notice the components API? Technically you can override anything that's in the structure (the component is headless).

    Could you set up a small example of what you have together so far?

  3. bebraw commented on Oct 21, 2018

    @bebraw
    Member
  4. dannyhuly commented on Oct 31, 2018

    @dannyhuly
    Author

    Its looks like using the Table.Provider renders (specifically the body.row) can help with wrapping the TableRow with a HOC.

    const RowWrapper = props => (<tr>...</tr>);
    <Table.Provider
      columns={...}
      renderers={{
        body: {
          row: RowWrapper
        }
      }}
    >
       ...
    <Table.Provider />

    The thing is that the RowWrapper only receives children.
    If props like property and rowData would pass throughה 'TableRow' then a RowWrapper would have the scope that I need.
    The bad thing about passing down extra props will be the additional renders on row rather then only render on cells (From what I understand).

    Close, but no cigar (yet).

  5. bebraw commented on Oct 31, 2018

    @bebraw
    Member

    @dannyhuly I'm working on a small re-design (separate branch) but I haven't gotten around to finishing it yet as I've been too busy with paid work (I do this one for free so it progresses slowly). Likely finishing that might help in this particular case as it makes the library more flexible.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions