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

123
Visualizações
When a datatable (jquery) has data after getting filtered, make a label visible

I have a DataTable (jQuery) that currently allows me to filter my data when I enter a string inside an input field. By default, a label is invisible.

After filtering, I want to be able to make a the label visible if the the dataTable after filtering contains data. Vice versa, if the dataTable is empty after filtering, I want the label to stay invisible.

I am relatively new to web-development so please excuse my lack of knowledge. The filtering of the datatables is client-side so im a but unsure on how to achieve this.

this is how i initialised the datatable

if the filter results in an empty dataTable, no label should appear

if the filter results in a datatable with data, a label should appear

about 4 years ago · Juan Pablo Isaza
1 Respostas
Responde à pergunta

0

You need to add a change event listener to your input field. Afterwards just check if the field content meets the required conditions and set the label's display style to style properties like

document.getElementById(labelname).style.display = 'none'
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