Issue with react-bootstrap-table2: Pagination dropdown feature malfunctioning

I am having trouble with the pagination drop down in react-bootstrap-table2.

Here are my options:

        const options = {
            paginationSize: 4,
            pageStartIndex: 0,
            //alwaysShowAllBtns: true, // Always show next and previous button
            //withFirstAndLast: false, // Hide the going to First and Last page button
            // hideSizePerPage: true, // Hide the sizePerPage dropdown always
            // hidePageListOnlyOnePage: true, // Hide the pagination list when only one page
            firstPageText: 'First',
            prePageText: 'Back',
            nextPageText: 'Next',
            lastPageText: 'Last',
            nextPageTitle: 'First page',
            prePageTitle: 'Pre page',
            firstPageTitle: 'Next page',
            lastPageTitle: 'Last page',
            sizePerPageList: [{
                text: '5', value: 5
            },{
                text: '10', value: 10
            },{
                text: 'All', value: this.state.currentlyDisplayed.length
            }] // A numeric array is also available. the purpose of above example is custom the text
        };

Below is how I implemented the Table Component:

                            <BootstrapTable
                                className="bsTable"
                                striped={true}
                                hover={true}
                                keyField='id'
                                data={this.state.currentlyDisplayed}
                                columns={columns}
                                pagination={ paginationFactory(options) }
                                filter={ filterFactory({delay:100}) }
                                fetchInfo={{dataTotalSize: this.state.currentlyDisplayed.length}}
                            />

I am hoping to see 5, 10, All in the drop down but it's not responding as expected. My table contains more than 5 records... Any suggestions?

Answer №1

To implement this style, include the following in your CSS:

.display.react-bs-table-sizePerPage-dropdown ul:last-child {
  visibility: visible;
}

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

Why is it preferable to use data URI instead of paths for images smaller than 10kb in React?

According to the information found in the Adding Images, Fonts, and Files section of the Create React App documentation, when importing images that are less than 10,000 bytes, a data URI is returned instead of a path. This rule applies to file extensions s ...

attempting to pass a boolean type through props resulting in a type error

Hey, check out this component I created: import * as Styled from './styles'; export type HeadingProps = { children: React.ReactNode | string; colorDark: boolean; }; export const Heading = ({ children, colorDark }: HeadingProps) => { re ...

Next JS Dynamic Routing displays successful message on invalid routes

I have been using the App Router feature in Next JS along with Strapi as my CMS. When I make a query to the API endpoint in Postman, I receive the expected results. Requests for routes without corresponding slugs return a 404 error, while only routes with ...

Strategies for transferring retrieved data to the getServerSideProps function

I am currently utilizing the Context API to retrieve data and then pass that data to the getServerSideProps function, but encountering the following error: The React Hook "useContext" is being called in a function "getServerSideProps" that is neither a Re ...

sending back a JSON object that appears empty, despite actually containing data

I'm facing an issue where I am attempting to send a json response to my react client, containing a list of songs (objects). However, the json returns as an empty array. This is how I am fetching the data: let songs = []; fetch("https://api.spotify. ...

What are the best practices for utilizing fetch() to retrieve data from a web API effectively?

Is there a way to store stock data in stockData and display it in the console upon form submission? Upon submitting the form, I only receive undefined. I suspect this may be due to a delay in fetching data from the API (but not certain). How can I resol ...

The overflow-x property causes the left side of the component to be cut off when scrolling

When the screen width is insufficient to display a component properly, I need it to be horizontally scrollable. However, when scrolling to the left after making it scrollable due to a smaller screen size, the left side of the component gets cut off and can ...

The given 'FC<ComponentType>' type argument cannot be assigned to the 'ForwardRefRenderFunction<unknown, ComponentType>' parameter type

Currently, I am using react in conjunction with typescript. Within my project, there are two components - one serving as the child and the other as the parent. I am passing a ref to my child component, and within that same child component, I am binding my ...

Leveraging the power of Framer Motion in combination with Typescript

While utilizing Framer Motion with TypeScript, I found myself pondering if there is a method to ensure that variants are typesafe for improved autocomplete and reduced mistakes. Additionally, I was exploring the custom prop for handling custom data and des ...

Enhance your material-system experience with styled-components

I am currently utilizing the stack above to customize Material components using the props provided by the Material system in conjunction with styled-components. The component I am testing is as follows: import React from 'react' import Grid from ...

Accessing an external API through a tRPC endpoint (tRPC Promise is resolved before processing is complete)

I want to utilize OpenAI's API within my Next.js + tRPC application. It appears that my front-end is proceeding without waiting for the back-end to finish the API request, resulting in an error due to the response still being undefined. Below is my e ...

Ensure the first column is aligned to the right and the second column is aligned to the left within a

After reviewing the official Bootstrap grid layout page, I noticed numerous examples of alignment. I am eager to find a class that will help achieve a layout similar to the one shown in https://i.stack.imgur.com/OPYrZ.png. I want all content in the first ...

Is it recommended that AJAX calls are placed on the server side?

As I work on my React/Express/Node application, I am facing a challenge with making AJAX requests to Instagram. Every time I attempt this, an error keeps popping up: No 'Access-Control-Allow-Origin' header is present on the requested resource. O ...

Updating a Nested Form to Modify an Object

There is an API that fetches an object with the following structure: { "objectAttributes": [ { "id": "1", "Name": "First", "Comment": "First" }, { "id": "2", "Name": "Second", "Comment": "Second" } ] ...

I'm having trouble getting my MERN app to run on Heroku. Any suggestions on how to resolve this issue?

I recently used Brad Traversys Guide to create a basic MERN Stack App with React.js, Redux.js, Node.js, Express.js, and MongoDB using create-react-app and Mlab. The app functions perfectly on my local server without any issues, but I am facing difficulties ...

Encountering an error with errno -100, code 'EPROTO', and syscall 'write' while trying to access localhost:3000 in my frontend repository

It's been a while since I last worked on this repository, and from what I remember, it was running smoothly before it went dormant for almost a year. I'm concerned that the SSL certificate may have expired or needs an update causing issues. I att ...

The Next.js testing process involves verifying that the component props object is not null when using both static and server-side props

Exploring Next.js with getStaticProps and getServerSide props, I developed a project to familiarize myself with the concepts. My simple component generates a table row based on user data. While I have not encountered any issues with null objects, I notice ...

Am I going too deep with nesting in JavaScript's Async/Await?

In the process of building my React App (although the specific technology is not crucial to this discussion), I have encountered a situation involving three asynchronous functions, which I will refer to as func1, func2, and func3. Here is a general outline ...

Is there a way to retrieve a raw value from the API response that matches the one shown in POSTMAN, but my attempts have been unsuccessful?

Looking for some assistance with fetching data from a front-end (React) to the raw value in JSON. Specifically, I'm having trouble with the login functionality. When I input my email and password, the response should match what I see in POSTMAN, but i ...

Displaying a dynamic list of components in NextJS: A step-by-step guide

On my website homepage, I am working on creating a list of decks categorized by each category. Here's how it looks: Category A: Deck 1 | Deck 2 | Deck 3 Category B: Deck 4 | Deck 6 Category C: Deck 7 I have figured out how to fetch all the cate ...