Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

156
Views
Cálculo de paginación (resultado por cálculo de página después de la clasificación)

Estoy tratando de desarrollar la paginación y tendré que descubrir cómo limitar mi conjunto de resultados por compensación de elementos. Logré implementar el recuento de páginas inicial, final y total de alguna manera. Sin embargo, cuando ordeno los datos del producto, los valores de recuento de páginas inicial, final y total siguen siendo los mismos.

p.ej.

antes ordenados -> Mostrando 1 a 10 de 60 (6 páginas)

después de ordenado -> Mostrando 1 a 10 de 0 (0 páginas)

 const totalProductCount = 60 const resultPerPage = 10 const currentPageNumber = 1 const totalPageCount = Math.round(totalProductCount / resultPerPage) const from = parseInt((currentPageNumber - 1) * resultPerPage) + 1 const to = parseInt(currentPage * resultPerPage) console.log(Showing {from} to {to} of {totalProductsCount} ({totalPageCount} Pages)) // Showing 1 to 10 of 60 ( 6 pages)

Sin embargo, después de ordenar los datos, el recuento totalProducts cae a 0 y el resultado sigue siendo el mismo.

 const totalProductCount = 0 const resultPerPage = 10 const currentPageNumber = 1 const totalPageCount = Math.round(totalProductCount / resultPerPage) const from = parseInt((currentPageNumber - 1) * resultPerPage) + 1 const to = parseInt(currentPage * resultPerPage) console.log(Showing {from} to {to} of {totalProductsCount} ({totalPageCount} Pages)) // Showing 1 to 10 of 0 ( 0 pages) // still same

about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!