Skip to content

Previous and Next button events of DataTables component are invalid #353

@jiangxuguang

Description

@jiangxuguang

The Previous and Next buttons of the DataTables component introduced in the system are invalid.

eg:
截屏2024-05-08 16 09 04

Temporary solution:

const dataTableParams = {
    ...
};
// define table
const table = $(`#${elementId} #grid`).dataTable(dataTableParams);
$('.dataTables_paginate ul').addClass('pagination');
// Manually add click events
$('.dataTables_paginate .pagination li').on('click', (event) => {
    if ($(event.currentTarget).hasClass('disabled')) {
        return;
    }
    if ($(event.currentTarget).hasClass('next')){
        table.fnPageChange( 'next' );
    }
    if ($(event.currentTarget).hasClass('prev')) {
        table.fnPageChange( 'previous' );
    }
});
...

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