Skip to content

Remote Pagination not working on react tabulator #293

@amilaofficework

Description

@amilaofficework

I'm using react tabulator 0.20.3 and trying to use remote pagination. Issue is my data loaded to table (first page with 10 records) but i can't find a way to set last_page value, therefore this only shows 1 as page count in the paging navigation. Also need to know the way of loading next set of data when user clicks on first,next,last or a page number from page navigation


this.options = {
    tooltips: true,
    movableColumns: true,
    pagination: "remote",
    paginationSize: 10,
    ajaxURL: 'dummy_string_url',
    download: true,
    ajaxRequestFunc: (url, config, params) => {
        let workFlowId = this.state.workflowId;
        let exerciseId = this.state.exerciseId;
        let caseState = this.state.caseState;
        let t = this.state.t;
        let _this = this;
        return new Promise(function(resolve, reject) {
            CaseAPI.all(workFlowId, exerciseId,
                caseState, t).then(AllCaseData => {
                // this content is an array of data, otherwise data is not visible on the table, i have tried {"data":[],"last_page":""} to resolve but it gave me a error.
                resolve(AllCaseData.data.content);
            });
        });
    },
    langs: {
        all: {
            pagination: {
                first: t("common.table.pagination.first"),
                first_title: t("common.table.pagination.first_title"),
                last: t("common.table.pagination.last"),
                last_title: t("common.table.pagination.last_title"),
                prev: t("common.table.pagination.prev"),
                prev_title: t("common.table.pagination.prev_title"),
                next: t("common.table.pagination.next"),
                next_title: t("common.table.pagination.next_title")
            }
        }
    }
};

<ReactTabulator columns={columns} options={this.options}/>

Any proper example of remote paging will also a help for me.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions