Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
jiangxuguang opened this issue May 8, 2024 · 0 comments
Open

Comments

@jiangxuguang
Copy link

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' );
    }
});
...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant