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

182
Visualizações
Click checkbox with jQuery

I'm building html dynamically with Ajax.

This code generates my table:

$(".row-info").append(`
    <div class="items_container ${value}" id="${value}">
        <div class="col-md-2 item_ref">${value}</div>
        <div class="col-md-6 item_description">${response[0].nombre}</div>
        <div class="col-md-3"><input type="number" class="form-control" value="1" style="width: 100%; text-align:center" /></div>
        <div class="col-md-1"><i class="fas fa-trash-alt fa-2x text-danger remove_line" style="cursor:pointer;"></i></div>
    </div>
`);

$(".remove_line").on("click", function () {
    $(".items_container." + value).remove();
    $("." + value).click();
});

enter image description here

This image it's result for my table created dynamically. I have a red trash image that if clicked it removes a line from the table.

I need to do that when I click remove checkbox checked, but when I clicked in this checkbox, change message.

I tried with: $('.'+value).click(); but my problem is that duplicate my entry in my table, always I can show my item selected. My message change, because detect when it's checked or not. But never remove my table line.

I don't know if have better solution to do this. And solve my problem.

Resume: when i click in checkbox "OFERTA" in left window, create iframe in right. When i check one checkbox in Iframes right I need create table resume in bottom.

Thanks for reading and sorry for my english.

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

0

SOLUTION

$(".remove_line_"+value).on('click', function(){
                                        $(this).closest('.items_container').remove();    
                                        if($("."+value).prop('checked', true)){
                                            $("."+value).click();
                                            $("."+value).prop('checked', false);
                                        }
                                    });
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