teragrep / ajs_01

User interface for Teragrep
Apache License 2.0
0 stars 0 forks source link

Improve graph table's pagination in narrow paragraphs #268

Open ronja-ui opened 1 month ago

ronja-ui commented 1 month ago

Description In narrow paragraphs the table pagination gets partially hidden (see the image).

Screenshot 2024-05-21 at 16-17-01 Teragrep

Investigate if it's possible to make the pagination show less page numbers, i.e. 1, 2, ..., 40.

BVVLD commented 3 minutes ago

According to the documentation: https://datatables.net/reference/feature/paging.buttons The amount of buttons can be set up to a custom odd number. However:

Please note that DataTables pagination control is responsive. It will automatically remove number buttons until the control fits onto a single line, as required by the page's layout.

This quote from documentation does not seem to be valid in our case. Additionally, any attempt to set the amount via "layout" or "paging" property in the initial DT configs failed, for both new and 2.0.0-2.0.3 naming conventions (the access to this configuration was different in early versions of DT, but we are using new versions anyway).

What worked: As mentioned in the comments of page: https://datatables.net/reference/option/pagingType The post-init configuration line worked just fine. The further configuration can be done by setting constant "pagerAmount" in datatable wrapper. Additionally, the buttons "First", "Next", "Previous" and "Last" can be removed all or partially, if needed.