Skip to content

Pagination & total  #1013

@Extazx2

Description

@Extazx2

Hello,

I have trouble understanding how the pagination works.
I work with firebase and to avoid many useless reads, I want to implement custom "page change".

I have a counter (at the time of my example : 39) in my database, that i collect, telling me how many docs I have, and i go through them 20 by 20 on each page (supposedly) instead of loading the whole firebase collection and let the table do the pagination itself.

Here is my table :
image

Here is the screen of my react dev tools
pagination_react_dev_tools

Here is my code :

        let options = {
            totalSize: nbCandidates,
            showTotal: true,
        };
        console.log(typeof nbCandidates);
        console.log(options);
        console.log(paginationFactory(options));
        if(candidates){
            return (<BootstrapTable keyField='cid'
                                    data={candidates}
                                    columns={columns}
                                    pagination={paginationFactory({...options})}/>);
        }

The thing is : if in the options, i change totalSize: nbCandidates to totalSize: 39 I will have 4 pages in my list (which is ok, because there is 10 rows per pages, 39 rows total.

output of console.log(typeof nbCandidates); is "number"

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions