React-bootstrap-table2: Pagination not playing nicely with Toolkit table search bar.

Created on 17 Aug 2018  路  11Comments  路  Source: react-bootstrap-table/react-bootstrap-table2

Looks like there's a bug when using both pagination and the search bar from the toolkit.

To reproduce:

  1. Search for something that returns 0 results using a full table search bar.
  2. Change the rows per page to something other than the current selection. e.g. from 10 to 20.
  3. Clear the search term from the search bar.

It throws the following error and crashes the app:

TypeError: Cannot read property 'name' of undefined

... where 'name' is the keyField passed to the ToolkitProvider.

Any ideas what this might be?

bug

Most helpful comment

@dillobird I think about 8/21 or 22.

All 11 comments

@dillobird ok, I will check this out, sorry for lately reply.

@dillobird btw, what version u used, list all of the related packages. thanks

@AllenFang No worries mate! Package versions below:

"react-bootstrap-table-next": "^1.1.1",
"react-bootstrap-table2-paginator": "^1.0.1",
"react-bootstrap-table2-toolkit": "^1.0.1",

ok, thank you

@AllenFang You鈥檙e a gentleman and a scholar. Thank you!

When鈥檚 the next release due out?

@dillobird I think about 8/21 or 22.

@dillobird we fixed this issue in [email protected], [email protected] and [email protected]. check this

Please reopen this issue if the problem still remain, thanks

Fixed! Thanks again @AllenFang.

@AllenFang I can reproduce the above bug in the latest version:
[email protected]
[email protected]
[email protected]
[email protected]

In addition, I have a related issue.
To reproduce:

  1. There are more than 10 rows and sizePerPage is 10.
  2. Search for some "SearchTerm1" in the SearchBar that returns 2 pages of results.
  3. Clear the search
  4. Go to page 3
  5. Search for the same "SearchTerm1"

Like above, it throws the following error and crashes the app:
Uncaught TypeError: Cannot read property 'name' of undefined
... where 'name' is the keyField passed to the ToolkitProvider.

I would really appreciate your help with this. And thank you for this library.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

bogannathan picture bogannathan  路  4Comments

eylonronen picture eylonronen  路  3Comments

nskiro picture nskiro  路  4Comments

Randore picture Randore  路  3Comments

harishkumarreddy12 picture harishkumarreddy12  路  3Comments