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

198
Visualizações
How can I get the name of the nav-tab that is parent to current element?

I do know how to get the name of nav-tab when it is shown, but I am trying to get the name of the tab of a child element when the child element is changed. Just getting the name of the last tab clicked/shown won't help. I am using asp.net MVC Razor and need to find out what changed on the page and on what tabs. The user technically could click tabs without changing anything. I tried doing something like this:

    $('body').on('change', '.form-control', function () {
        var tab = this.closest('nav-tab');
    })

I have also tried:

    $('body').on('change', '.form-control', function () {
        var tab = this.closest('.nav-tab');
    })

but that did not work. There may be a better way to accomplish what I need. Any assistance is greatly appreciated.

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

0

Have you looked through the DOM to see where its nested? I've had luck in tables just going up to the TR then doing a find with the class. Maybe this sample will help?

$(".ctxMenu li").click(function () {
    var thisLink = $(this).closest("tr").find("input[id$='" + $(this).attr("data-action") + "']").attr("id");
    if (thisLink != "undefined") {
        $(this).closest("tr").find("input[id$='" + $(this).attr("data-action") + "']").click();
    }
    $(".ctxMenu").hide(100);
});
$(".jqSaveChangeDiv").change(function (e) {
    $(this).closest("div").find(".jqQuickUpdate2").trigger("click");
    console.log("Updated " + $(this).closest("div").find(".jqQuickUpdate2").attr("id"));
});
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