Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DataTable: error occurs when the field corresponding to the column is an Map, and the editor is not specified #3332

Closed
yanxiyue opened this issue Sep 16, 2022 · 0 comments · Fixed by #3186 or #3333
Assignees
Labels
Type: Bug Issue contains a defect related to a specific component.
Milestone

Comments

@yanxiyue
Copy link
Contributor

Describe the bug

error occurs when the field corresponding to the column is an Map, and and the editor is not specified

const dynamicColumns = columns.map((col, i) => {
    let body = col.body ? col.body(col.field) : null;
    let editor = col.editor? col.editor: null;
    return (
      <Column
        key={col.field}
        field={col.field}.  
        header={col.header}
        body={body}
        filter={col.filter}
        filterApply={filterApplyTemplate}
        editor={editor}
      />
    );
  });

image

Reproducer

No response

PrimeReact version

8.5.0

React version

18.x

Language

ES6

Build / Runtime

Create React App (CRA)

Browser(s)

No response

Steps to reproduce the behavior

No response

Expected behavior

render the orignal column body under edit mode.

I have tried to fix it like this commit, and it works as expected.

@yanxiyue yanxiyue added the Status: Needs Triage Issue will be reviewed by Core Team and a relevant label will be added as soon as possible label Sep 16, 2022
@yanxiyue yanxiyue changed the title DataTable: error occurs when the field corresponding to the column is an Map, and and the editor is not specified DataTable: error occurs when the field corresponding to the column is an Map, and the editor is not specified Sep 16, 2022
@melloware melloware added Type: Bug Issue contains a defect related to a specific component. and removed Status: Needs Triage Issue will be reviewed by Core Team and a relevant label will be added as soon as possible labels Sep 16, 2022
@melloware melloware added this to the 8.6.0 milestone Sep 16, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Bug Issue contains a defect related to a specific component.
Projects
None yet
2 participants