All Projects → unknwon → paginater

unknwon / paginater

Licence: Apache-2.0 license
Package paginater is a helper module for custom pagination calculation.

Programming Languages

go
31211 projects - #10 most used programming language
Makefile
30231 projects

Projects that are alternatives of or similar to paginater

RxPagingLoading
Easy handling of the Paging or Loading screens states
Stars: ✭ 45 (+0%)
Mutual labels:  pagination
go-paginate
Cursor-based go paginator
Stars: ✭ 48 (+6.67%)
Mutual labels:  pagination
discord-paginationembed
A pagination utility for MessageEmbed in Discord.JS
Stars: ✭ 93 (+106.67%)
Mutual labels:  pagination
FutureBuilderWithPagination
we're gonna look out how to work with Future Builder and show the result in GridView. We'll also see how to use Pagination with Future Builder.Future Builder is a widget that returns another widget based on futures execution result. It builds itself based on the latest AsyncSnapshots.
Stars: ✭ 45 (+0%)
Mutual labels:  pagination
developer-guides
Developer Guides
Stars: ✭ 25 (-44.44%)
Mutual labels:  pagination
RxPagination
Implement pagination in just few lines with RxPagination
Stars: ✭ 20 (-55.56%)
Mutual labels:  pagination
mongoose-aggregate-paginate-v2
A cursor based custom aggregate pagination library for Mongoose with customizable labels.
Stars: ✭ 103 (+128.89%)
Mutual labels:  pagination
paginathing
a jQuery plugin to paginate your DOM easily.
Stars: ✭ 23 (-48.89%)
Mutual labels:  pagination
Gridify
Easy and optimized way to apply Filtering, Sorting, and Pagination using text-based data.
Stars: ✭ 372 (+726.67%)
Mutual labels:  pagination
graphql-compose-pagination
Plugin for TypeComposer (graphql-compose), that adds `pagination` resolver.
Stars: ✭ 29 (-35.56%)
Mutual labels:  pagination
go-import-server
HTTP server for canonical "go get" import path
Stars: ✭ 29 (-35.56%)
Mutual labels:  lsif-enabled
pagination
Aplus Framework Pagination Library
Stars: ✭ 167 (+271.11%)
Mutual labels:  pagination
spring-boot-jpa-rest-demo-filter-paging-sorting
Spring Boot Data JPA with Filter, Pagination and Sorting
Stars: ✭ 70 (+55.56%)
Mutual labels:  pagination
vue-pagination
🔵一个`bootstrap`风格的`vue.js`(2.0)分页组件
Stars: ✭ 28 (-37.78%)
Mutual labels:  pagination
QueryMovies
This repository shows a Android project with Clean Architecture, Functional Reactive Programming and MVP+Dagger
Stars: ✭ 16 (-64.44%)
Mutual labels:  pagination
vue3-table-lite
A simple and lightweight data table component for Vue.js 3. Features sorting, paging, row check, dynamic data rendering, supported TypeScript, and more.
Stars: ✭ 148 (+228.89%)
Mutual labels:  pagination
kaminari-sinatra
Kaminari Sinatra adapter
Stars: ✭ 26 (-42.22%)
Mutual labels:  pagination
lampager-laravel
Rapid pagination for Laravel
Stars: ✭ 71 (+57.78%)
Mutual labels:  pagination
jekyll-pagination
Better pagination for Jekyll.
Stars: ✭ 19 (-57.78%)
Mutual labels:  pagination
SwiftyUIScrollView
A custom ScrollView wrapper that comes with Pagination and Page Control.
Stars: ✭ 18 (-60%)
Mutual labels:  pagination

Paginater

GitHub Workflow Status codecov GoDoc Sourcegraph

Package paginater is a helper module for custom pagination calculation.

Installation

go get github.com/Unknwon/paginater

Getting Started

The following code shows an example of how to use paginater:

package main

import "github.com/Unknwon/paginater"

func main() {
	// Arguments:
	// - Total number of rows
	// - Number of rows in one page
	// - Current page number 
	// - Number of page links to be displayed
	p := paginater.New(45, 10, 3, 3)
	
	// Then use p as a template object named "Page" in "demo.html"
	// ...
}

demo.html

{{if not .Page.IsFirst}}[First](1){{end}}
{{if .Page.HasPrevious}}[Previous]({{.Page.Previous}}){{end}}

{{range .Page.Pages}}
	{{if eq .Num -1}}
	...
	{{else}}
	{{.Num}}{{if .IsCurrent}}(current){{end}}
	{{end}}
{{end}}

{{if .Page.HasNext}}[Next]({{.Page.Next}}){{end}}
{{if not .Page.IsLast}}[Last]({{.Page.TotalPages}}){{end}}

Possible output:

[First](1) [Previous](2) ... 2 3(current) 4 ... [Next](4) [Last](5)

As you may guess, if the Page value is -1, you should print ... in the HTML as common practice.

Getting Help

License

This project is under Apache v2 License. See the LICENSE file for the full license text.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].