Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

199
Views
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 answers
Answer question

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 Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!