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

177
Visualizações
Jquery datatables show only selected

I have a simple HTML table, where first "td" is customized to be an ID input checkbox :

<table class="table" id="mytable">
    <thead>
        <tr>
            <th scope="col">Col1</th>
            <th scope="col">Col2</th>
            <th scope="col">Col3</th>
        </tr>
    </thead>
    <tbody>
        <tr>
            <td><input type=checkbox name="id-1" value=1></td>
            <td class="id">ID</td>
            <td class="name>NAME</td>
        </tr>
        <tr>
            <td><input type=checkbox name="id-2" value=2></td>
            <td class="id">ID</td>
            <td class="name>NAME</td>
        </tr> 
    ....... A lot of more rows, some already checked ..........
    </tbody>
</table>

Then I am using Jquery Datatable to "enhance" the table to be a Datatable :

$('#mytable').DataTable();

Since some values could be already checked during table rendering, I'm trying to figure out the most effective way to add a "show only selected/show all" button that filters the datatable and only show checked checkbox.

Is there a way to do it directly with Datatable without involving external code or what's the best way to achieve this?

I read about a legacy extension named "TableTools" that should ease this, but it seems being deprecated from a long time.

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