select number records returned
This commit is contained in:
@@ -4,6 +4,7 @@ import useTranslation from "next-translate/useTranslation";
|
||||
|
||||
const PaginationControl = (props) => {
|
||||
const {
|
||||
showNoOfRecords,
|
||||
orderBy,
|
||||
fieldSort,
|
||||
searchString,
|
||||
@@ -17,7 +18,9 @@ const PaginationControl = (props) => {
|
||||
const router = useRouter();
|
||||
const { locale } = router;
|
||||
|
||||
const pagesCount = Math.ceil(searchResultsObj["@odata.count"] / 10);
|
||||
const pagesCount = Math.ceil(
|
||||
searchResultsObj["@odata.count"] / showNoOfRecords
|
||||
);
|
||||
|
||||
const getRange = (start, end) => {
|
||||
//console.log(start, end);
|
||||
@@ -29,9 +32,9 @@ const PaginationControl = (props) => {
|
||||
const paginationNumbers = (currentPage, pageCount) => {
|
||||
//console.log(currentPage);
|
||||
let delta;
|
||||
if (pageCount <= 10) {
|
||||
if (pageCount <= showNoOfRecords) {
|
||||
// delta === 7: [1 2 3 4 5 6 7]
|
||||
delta = 10;
|
||||
delta = showNoOfRecords;
|
||||
} else {
|
||||
// delta === 2: [1 ... 4 5 6 ... 10]
|
||||
// delta === 4: [1 2 3 4 5 ... 10]
|
||||
|
||||
Reference in New Issue
Block a user