Skip to content

Handle configuring menu, onDeleteRow per row #4

@jacobp100

Description

@jacobp100

One idea is for each property to be able to be set/unset on the component at the top level, in the section, and/or in the row. I.e.

<TableView
  onDeleteRow={fn1}
  sections={[
    {
      ...section,
      onDeleteRow: fn2,
      data: [
        {
          onDeleteRow: fn3,
          value: "something",
        },
      ],
    },
  ]}
/>

So fn3 overrides fn2 overrides fn1 - and if fn3 was undefined, it would unset it (so the row isn't deletable)

This needs to be done for

  • onDeleteRow
  • menu

This needs the type section.data to be refactored to allow these props

The advantage of this - rather than having things like the menu prop being a function - is that we can minimise the data sent over the bridge.

Metadata

Metadata

Assignees

No one assigned

    Labels

    help wantedExtra attention is needed

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions