Paginator: Cannot read property 'options' of undefined
See original GitHub issueIn my container that is using bootstrap-table2 I optionally set pagination:
const pagination =
numPages > 1
? paginationFactory({
page: options.page,
//other values
})
: undefined;
However the script here somehow assumes pagination.
This will error in Cannot read property 'options' of undefined when previously there were 2 pages but deleting the only item on the second page causes no more than one page (so pagination props is undefined).
The following code will reproduce the error:
https://github.com/amsterdamharu/table-bug
Worked around this issue by always setting pagination but if there is only one page it’ll be hidden with css:
const pagination = paginationFactory({...})
...
<div className={classNames({ ['hide-pagination']: numPages === 1 })}>
<BootstrapTable
pagination={pagination}
css:
div.hide-pagination > div.row.react-bootstrap-table-pagination {
display: none;
}
Issue Analytics
- State:
- Created 5 years ago
- Comments:7 (5 by maintainers)
Top Results From Across the Web
Cannot read property 'page' of undefined when making a ...
I'm at a loss for figuring out why paginator is undefined. Any ideas? My personal repo can be found here: git clone https://github.com/Atticus29 ......
Read more >ERROR TypeError: Cannot read properties of undefined ...
You're trying to read the property 'page' of 'this.paginator'. 'this.paginator' doesn't appear to be defined anywhere in your code, and as the ...
Read more >Unexpected compilation error: Cannot read property 'type' of null
But while deploying my code i am getting LWC1001: Unexpected compilation error: Cannot read property 'type' of null.
Read more >Vue warn - Cannot read property 'length' of undefined
Well, it seems that products.data is empty. You need to make sure products.data is filled here to perform .lenght . If you probably...
Read more >ANGULAR 13 TypeError Cannot read property of undefined
In this tutorial, we will see a most common error faced by the Angular developers named as "TypeError Cannot read property of undefined...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

@amsterdamharu Please upgrade to
react-bootstrap-table-next@1.3.0andreact-bootstrap-table2-editor@1.2.0RELEASE NOTE
👍