Repository navigation
Cannot read property 'id' of undefined + The above error occurred in the <SelectionProvider> component: #1669
Description
Activity
Same issue here. I've tried specifically defining the
selectedkeys onselectRow, but it doesn't fix it. Basically this issue occurs when navigating to a new page and then changing thedata. Quite a substantial oversight, as it doesn't allow the case of selecting and filtering to work with pagination.I'm now going to try to find a workaround, and I'd consider making a PR fix, but this repo doesn't seem like it is being maintained.
@bfricka Thanks a lot, I am also trying to fix it, I will post here if I can fix it, between if you find any solution, plz post the solution here. Thanks again :)
Hello, I had a similar issue and did a short investigation on it. I found the following
In the
node_modules/react-bootstrap-table-next/lib/src/utils.jsthere is get function that accepts two parameters (target, field) as it is shown belowfunction get(target, field) { var directGet = target[field]; if (directGet !== undefined && directGet !== null) { return directGet; } var pathArray = splitNested(field); var result = void 0; try { result = pathArray.reduce(function (curr, path) { return curr[path]; }, target); } catch (e) {} return result; }
The problem is that in some cases the target parameter is undefined and that throws that error.
So I wrapped the entire body function inside the try/catch block in order to catch the error as it is shown below
function get(target, field) { var result = void 0; try { var directGet = target[field]; if (directGet !== undefined && directGet !== null) { return directGet; } var pathArray = splitNested(field); result = pathArray.reduce(function (curr, path) { return curr[path]; }, target); } catch (e) {} return result; }
I hope that this will be useful to you too. This is not a proper fix though. The developers of the library has to take a look at it :)
Thanks @myapos will check with that solution, between for the current project I have implemented https://react-table.tanstack.com/ package.
Reacted by Myron ApostolakisI made a PR too. I hope the developers will merge at least one of them. It is a simple fix.
Reacted by ardynugrahaFaced same issue and implemented my own pagination component
and here how I'm using it.
Reacted by Huzaifa AhmedI am facing the same issue what is the solution
Faced same issue and implemented my own pagination component
and here how I'm using it.
This just works great, thanks for this
In case you are using pagination that need to fetch new data from the api on page change you need to enable the "remote" prop and you need to handle onTableChange by yourself. documentation
Just pass - remote={{pagination: true } } in BootstrapTable. It will work
Hi Allen,
The bug
I want all these functionalities in single table searching in all fields + paging, it works fine for the first time, but after navigating to another page and searching for something generates error. for your reference have added code snippet and error,
Code Snippet
To Reproduce
Steps that generate errors:
Error Screenshots
If applicable, add screenshots to help explain your problem.