Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

215
Vistas
Angular Devextreme - Get total number of rows on current page

In my Angular App, I have a requirement to display total number of rows on current page in pagination section. But currently Devextreme grid row count returns total row count irrespective of page.

Below is my code :-

<dxo-paging [pageSize]="5"> </dxo-paging>
    <dxo-pager
        [visible]="true"
        [allowedPageSizes]="allowedPageSizes"
        [displayMode]="displayMode"
        [showPageSizeSelector]="showPageSizeSelector"
        [showInfo]="true"
        infoText="Displaying {0} -  {2} of {1} "
        [showNavigationButtons]="showNavButtons"
      >
      </dxo-pager>

Below screenshot :- enter image description here

Now i have only 5 rows in the grid but it shows 11 which is the total row count which i have received from database. Please advise.

about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

If i understand correctly, you want to show 1-5 on the first page, 6-10 on the second page and so on. You can achieve that by binding a function to the [infoText] property and customize the text output. This is not found in the official documentation but it works.

HTML:

<dxo-paging [pageSize]="5"> </dxo-paging>
<dxo-pager
    [visible]="true"
    [allowedPageSizes]="allowedPageSizes"
    [displayMode]="displayMode"
    [showPageSizeSelector]="showPageSizeSelector"
    [showInfo]="true"
    [infoText]="infoText"
    [showNavigationButtons]="showNavButtons">
</dxo-pager>

JS/TS:

infoText(currentPageNumber, totalPageCount, totalRowCount) {
    const myPageSize = 5; // use global variable instead and bind it to dxo-paging
    const from = +currentPageNumber * myPageSize - (myPageSize - 1);
    const to = +currentPageNumber * myPageSize;
    return `Displaying ${from}-${to}`;
}
about 4 years ago · Juan Pablo Isaza Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda