question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[Feature request]: NDataTable pagination prefix support total items

See original GitHub issue

This function solves the problem (这个功能解决的问题)

Total number of items displayed

Expected API (期望的 API)

pagination: {
        page: 1,
        pageSize: 15,
        pageSizes: [15, 25, 50, 100],
        pageCount: 101,
        showQuickJumper: true,
        showSizePicker: true,
            prefix: (info) => {
              // here, `info.total`
              return `${info.startIndex + 1}-${
                info.endIndex + 1
              } item / total: ${info.total||0}`;
            },
      },

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Reactions:1
  • Comments:6 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
Talljackcommented, Jul 24, 2021

Total information will not be available in asynchronous state

User can fill it by pagination.itemCount

itemCount is total, user must fill it

In non-remote mode, we should fill it for user by data.length

In non-remote mode, we should fill it for user by data.length In remote mode, user fill it by itemCount

0reactions
07akionicommented, Jul 24, 2021

Total information will not be available in asynchronous state

User can fill it by pagination.itemCount

itemCount is total, user must fill it

In non-remote mode, we should fill it for user by data.length

In non-remote mode, we should fill it for user by data.length In remote mode, user fill it by itemCount

Yes

Read more comments on GitHub >

github_iconTop Results From Across the Web

NDataTable pagination prefix support total items · Issue #585 ...
This function solves the problem (这个功能解决的问题) Total number of items displayed Expected API (期望的 API) pagination: { page: 1, ...
Read more >
Pagination doesnot work — DataTables forums
Hi, Im using datatable-1.10.12 with .net webservice as backend service. data table is getting records from the server .
Read more >
datatables serverside processing with unknown number of rows
We have data for which the query to get the total-count is almost as expensive as just querying all records. It would be...
Read more >
DataTables Plugin - Lotar's Wiki
Options ; page-length, Number of elements to display per page, integer ; paging, Enable or disable table pagination, boolean ; paging-type, Pagination button ......
Read more >
Working with jQuery DataTables - SitePoint
In this article we'll go through the basics of the jQuery DataTable and how to use some of the advanced features.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found