Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

222
Visualizações
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 Respostas
Responde à pergunta

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 Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda