Skip to content

newbienewbie/pagination-info

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

calculate pagination infomation according to total records ,pagesize, and current page number

the core function :

function calculatePaginationInfo(totalRecords=10,pageSize=10,currentPage=1,semiBandWidth=5)

return a object:

{
    totalRecords,
    totalPages,
    current:currentPage,
    pageSize,
    semiBandWidth,
    firstPage:1,
    lastPage:lastPage,
    previous:previousPage,
    next:nextPage,
    firstDigit,
    lastDigit,
    arraySize, 
    array,          // array of page number : [firstDigit,LastDigit]
    shouldDisply,   // should dispaly pagination ( when the length of array is less than 2 )
}

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published