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

72
Visualizações
Getting to specific data in jQuery

I am trying to add an ability to change the contents of one of the columns in the data table (its data cells should be editable). I was using this tutorial as a reference:

https://www.youtube.com/watch?v=LbhVVN5ffi0

its source code: https://github.com/divanov11/table-edit-backend

And so, I have the following functions in my template:

function edit_description(place){
            var targetId = $(this).attr("id");
            var value = $(this).text();

            var targetIN = $(this).attr("identificationNumber");

            $(this).unbind();

            $(this).html(`<input class="description form-control" data-target="${targetId}" type="text" value=${value}>`);

            $(`.description`).on('keypress', function(e){
                if (e.which == 13) {
                    var target = $(this).attr("data-target");
                    var description = $(`#${target}`).text($(this).val());
                    save_description(description, targetIN);
                    return false;
            }
        })
        }

        function save_description(description, identification_number){
            console.log('Saved!');

            var user_input = {"identificationNumber":identification_number, "description":description};
            update_description_POST(user_input);

        }

After typing in for example "chipset" I get the following description's value:

<td identificationnumber = "1234" id="description-1234">chipset</td>

I would need the description's value to be just "chipset". How to achieve that?

about 4 years ago · Juan Pablo Isaza
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