React Bootstrap Table KeyField with two Primary Key

1.3k Views Asked by At

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.

1

There are 1 best solutions below

0
On BEST ANSWER

keyField(required) - [String]

BootstrapTable

I would make it in combination string, for example

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