Skip to content

Infragistics Community Forum / Web / Ignite UI for ASP.NET MVC / Get parent tree node in nodeClick client event ASP.NET MVC

Get parent tree node in nodeClick client event ASP.NET MVC

New Discussion
Ray White
Ray White asked on Dec 24, 2025 9:48 AM

How do you get the parent tree node in the nodeClick JavaScript event? And, where is the documentation source for this information?

Here is my tree with the nodeClick client event:

@(Html.Infragistics().Tree()
    .ID("FilterTree")
    .Bindings(b1 =>
    {
        b1
        .ValueKey("Value")
        .TextKey("Text")
        .ImageUrlKey("Base64ImageUrl")
        .ChildDataProperty("ChildItems");
    })
    .DataSource(Model.TreeListItems)
    .DataBind()
    .ClientEvents(new Dictionary<string, string> { { "nodeClick", "FilterTreeNodeClicked" } })
    .Render()
)

Here is my JavaScipt event:

function FilterTreeNodeClicked(evt, ui) {

    // This is NOT the tree node. Instead, it looks like a DOM element
    var ParentNode = $("#FilterTree").igTree("parentNode", ui.node.element);

    // I need the parent for ui.node

}

Sign In to post a reply

Replies

  • 0
    Viktor Kombov
    Viktor Kombov answered on Mar 30, 2022 6:52 PM

    Hello Ray,

    Thank you for posting in our community.

    This is an initial update to let you know that we have received your support request regarding how to get parent tree node in nodeClick client event in ASP.NET MVC and I am currently looking into this matter for you. I will keep you posted on my progress and I will get back to you soon with more information or questions for you.

    Please feel free to continue sending updates to this case at any time.

    Regards,
    Viktor Kombov
    Entry Level Software Developer
    Infragistics, Inc.

    • 0
      Viktor Kombov
      Viktor Kombov answered on Mar 31, 2022 3:16 PM

      Hello Ray,

      Thank you for your patience while I was looking into this matter for you.

      Indeed the parentNode method returns a jQuery node element. However, having this element, you can use the nodeFromElement method of igTree in order to get the node object of the parent:

      function FilterTreeNodeClicked(evt, ui) {
          var parentNodeElement = $("#tree").igTree("parentNode", ui.node.element);
          var parentNodeObject = $("#tree").igTree("nodeFromElement", parentNodeElement);
      }

      I believe you will find the following documentation regarding the igTree control very helpful:

      API reference

      Help topics

      Online samples

      Please do not hesitate to contact me if you need any further assistance with this matter.

      Regards,
      Viktor Kombov
      Entry Level Software Developer
      Infragistics, Inc.

      • 0
        Ray White
        Ray White answered on Mar 31, 2022 4:34 PM

        Works perfectly. Thanks!

      • 0
        Viktor Kombov
        Viktor Kombov answered on Mar 31, 2022 7:23 PM

        Hello Ray,

        I am glad that you find my suggestion helpful!

        Thank you for choosing Infragistics components!

        Regards
        Viktor Kombov
        Entry Level Software Developer
        Infragistics, Inc.

      • 0
        James Davis
        James Davis answered on Jul 5, 2025 4:42 AM

        The Rice Purity Test is a harmless questionnaire designed to assess an individual's exposure to a variety of situations. It poses no physical or psychological hazards. However, it is important to remember that the test's questions may touch on sensitive issues or elicit emotional responses in certain people.

      • 0
        Essa Mattou
        Essa Mattou answered on Aug 22, 2025 3:53 AM

        Thank! Head Soccer

  • 0
    Oka Koni
    Oka Koni answered on Oct 1, 2024 11:00 AM

    I am appreciative for your tremendous aid in furthering my professional development and cultivating a positive outlook. driving directions from one place to another

  • 0
    anime xin
    anime xin answered on Oct 8, 2024 1:03 PM

    The cI guess i have to learn some coding logics from you  animexin.live

  • 0
    Francis Hua
    Francis Hua answered on Oct 18, 2024 6:25 AM

    To get the parent tree node in the nodeClick client event in an ASP.NET MVC application using the Ignite UI for jQuery Tree (igTree), you can use the parentNode method. The parentNode method allows you to retrieve the parent node of the clicked node.

    In your code, you correctly identified the parentNode method, but it's important to understand how to access the ui.node element correctly, as ui.node represents the tree node object, not a DOM element directly.

    visit: basketball legends

  • 0
    vic tor
    vic tor answered on Dec 24, 2025 9:48 AM

    I found the post to be quite engaging, although it required considerable effort to read through all the comments. Baseball Bros game.

  • You must be logged in to reply to this topic.
Discussion created by
Favorites
Replies
Created On
Last Post
Discussion created by
Ray White
Favorites
0
Replies
10
Created On
Dec 24, 2025
Last Post
2 months ago

Suggested Discussions

Created by

Created on

Dec 24, 2025 9:48 AM

Last activity on

Dec 24, 2025 9:48 AM