Yap Jun Hong
Yap Jun Hong

Reputation: 21

React Bootstrap Table KeyField with two Primary Key

I have a table with two columns that are both primary keys. How do I define the KeyField with two primary key?

prikeyarr contains [book_id, author_id].

<BootstrapTable keyField={props.prikeyarr} data={props.records} columns={columns} striped />

The code above gives me error warnings...

Therefore, in this case, I can only put one primary key as the keyField.

Upvotes: 0

Views: 1520

Answers (1)

myeongkil kim
myeongkil kim

Reputation: 2586

keyField(required) - [String]

BootstrapTable

I would make it in combination string, for example

primaryKeyString=`${book_id}_${author_id}`

Upvotes: 1

Related Questions