How to do pagination right?
See original GitHub issueAll the examples out there, rely on fixed JSON files, that don’t show how you can do pagination by using JS.
I’m working with DynamoDB, and when I query for the data, I’m adding the data to the table like so:
//
// -> Execute the command
//
obj.ddb.query(params, function(error, data) {
//
// 1. Check if there was an internal error
//
if(error)
{
console.info(params);
return console.error(error);
}
data.Items.forEach(function(item) {
//
//
//
$('#table').bootstrapTable('insertRow', {
index: 1,
row: item
});
});
});
This works fine, but there isn’t a clear explanation how to go about doing the pagination. My questions are:
- How can I add the total amount of items with JS?
Issue Analytics
- State:
- Created 4 years ago
- Comments:9
Top Results From Across the Web
Pagination – Examples And Good Practices
Good Practices Of Pagination Design # · Provide large clickable areas · Don't use underlines · Identify the current page · Space out...
Read more >Pagination - Bootstrap
Pagination is built with list HTML elements so screen readers can announce the number of available links. Use a wrapping <nav> element to...
Read more >CSS Pagination Examples - W3Schools
Learn how to create a responsive pagination using CSS. Simple Pagination. If you have a website with lots of pages, you may wish...
Read more >Bootstrap alignment of button and pagination - Stack Overflow
I am using Twitter Bootstrap 3 to build my new website. I want to place a button on the left side and a...
Read more >A simple guide to Pagination in React | by Kunal Nalawade
So, you can implement pagination on the backend side itself and fetch the data one page at a time. Here too, you may...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
As already explained its only possible to load the data in chunks with ajax.
So your only option is to load the whole data into the table and then use the pagination option to only display some rows per page. The next version (will be released soon) can handle a lot of data without ajax, the current version have some perfocmance issues with large datasets, so you can only try if that is a way for you or not.
But how then I tell the table there is more data that the user can get? Aaaaaaa 🤪