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

572
Visualizações
recordsTotal, recordsFiltered explanation Jquery DataTable

I'm reading datatable doc's but i can't find an answer. My question is:

I have a table with 10.000 rows. I do a search by state and result is 3000 rows. From 3000 rows, i'll show 20 per page.

"recordsTotal": what value should be in here?, "recordsFiltered": what value should be in here?,

If recordsTotal value must be 10.000, can i hide this value if is not interesting?

about 4 years ago · Santiago Trujillo
1 Respostas
Responde à pergunta

0

From official documentation:

recordsTotal

Total records, before filtering (i.e. the total number of records in the database)

recordsFiltered

Total records, after filtering (i.e. the total number of records after filtering has been applied - not just the number of records being returned for this page of data).

Your response should be:

{
    "draw": 1,
    "recordsTotal": 10000,
    "recordsFiltered": 3000,
    "data": [
       // ... skipped 20 records ...
    ]
}

I believe recordsTotal is only used for informational panel Showing 1 to 20 of 3000 entries (filtered from 10000 total entries). If you're not using informational panel, you don't have to return recordsTotal property.

Property recordsFiltered is also used by jQuery DataTables to calculate number of pages required to display your dataset.

See Server-side - Returned data for more information.

about 4 years ago · Santiago Trujillo 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