AllenFang / AllenFang/react-bootstrap-table

Hide ID field when inserting data

Open
#1,912 4 comments 0 reactions 0 assignees View on GitHub
Dominant language
JavaScript
Stars
2.2k
Forks
761
PR merge metrics
No merged PRs in 30d

Description

Hi,
Thanks for this awesome component.
I am trying to setup a form for my table that hides the id field when inserting a new row (my backend will generate it for me). I have tried lots of things and nothing worked.
First of all I have tried to set isKey and autovalue like this:
```

ID
Name

```

Note that autovalue is not in camelcase like in the documentation, but it seems that in my version of the module is all in lowercase. This still shows the field and adds no value to it.

I have also tried to user hiddenOnInsert and have a onAddRow function that populates the id. No luck.

Third thing I have tried is to use hiddenOnInsert and have a customInsertEditor where getFieldValue always returns a dummy number. That didn't work either. If I hide the id field I always get the error: "id can't be empty value".

What would be the best solution for this problem?

Thank you

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.