Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9148087
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T11:10:38+00:00 2026-06-17T11:10:38+00:00

I know the exact route to find a nested node in a Kendo tree

  • 0

I know the exact route to find a nested node in a Kendo tree view. So I wish to expand all nodes along this route to go and get there.
I know how to find a node and make Kendo expand that node.

My Treeview uses a web-api for its data and all works well. The schema is defined as follows:

            schema: {
                model: {
                    id: "CodeList",
                    hasChildren: "HasKids"
                }
            }

What I want to achieve is for the tree to expand automatically to a nested level.
Say I know the path to get to a node is ‘Level1CodeA|Level2CodeA|Level3CodeA’ so first I wish to find the code ‘Level1CodeA’ which I can do.
I then wish to expand this node (internally it retrieves the data under this node and it expands ok) after which I want to find ‘Level2CodeA’, repeat the process so also find and then select Level3CodeA.

How would I go about this? I was looking for an ‘AfterExpanded’ event that I could use to start the next search and expand operation but I can’t find any event I can use. I tried the ‘change’ event on my datasource but this is fired many times and I can’t seem to narrow it down to the correct item..

Many thanks.

EDIT: more code

<script id="treeII-template" type="text/kendo-ui-template">
    <img id="explorerItemImg" src="#: item.Image #" />
    <span id="explorerItemCode">#: item.Code #</span> - 
    <span id="explorerItemFullName">#: item.FullName #</span>
    # if (item.Level < (item.Levels - 1)) { #
        [<span id="explorerItemLCount">#: item.LCount #</span>]
    # } #
    # if (item.HasKids) { #
        [<span id="explorerItemPCount">#: item.PCount #</span>]
    # } #

</script>

The code to create the HierarchicalDataSource and assigning this to the treeview:

    // -----------------
    // set the datasource for the bottom explorer...
    // -----------------
    var loadDataForExplorerGroup = function (context, groupid, groupsequence) {

        // hang on to this context/groupid
        sessionStorage.setItem(context + "_explorer_groupId", groupid);
        sessionStorage.setItem(context + "_explorer_groupSequence", groupsequence);

        // define the datasource and attach it to the explorer-tree
        explorerGroupData = new kendo.data.HierarchicalDataSource({
            transport: {
                read: {
                    url: "/api/explorerapi/GetExplorerData?",
                    data: {
                        context: "portfolio",
                        groupid: groupid,
                        groupsequence: groupsequence,
                        userid: sessionStorage.getItem("symUserID")
                    }
                }
            },
            schema: {
                model: {
                    id: "CodeList",
                    hasChildren: "HasKids"
                }
            }
        });

        // simply assign the data source again to the tree
        $("#idExplBottomTree").data("kendoTreeView").setDataSource(explorerGroupData);

    };
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-17T11:10:40+00:00Added an answer on June 17, 2026 at 11:10 am

    That AfterExpanded event might be dataBound. What I would propose is given the following TreeView definition:

    var tree = $("#treeview").kendoTreeView({
        dataSource   : data,
        dataTextField: "text",
        dataBound    : function (e) {
            treeNavigateNext();
        }
    }).data("kendoTreeView");
    

    I’ve added dataBound handler that invokes treeNavigate defined as:

    function treeNavigateNext() {
        if (search.length > 0) {
            var first = tree.findByText(search[0]);
            if (first) {
                search.shift();
                tree.expand(first);
            }
        }
    }
    

    Where search is an array containing dataTextField of each node that we want to navigate.

    Example:

    search = [];
    search.push("t_3");
    search.push("t_32");
    search.push("t_321");
    search.push("t_3214");
    

    Defines that we want to expand a node which text is t_3, then t_32, next t_321 and finally t_3214.

    So treeNavigateNext checks that there is still something pending (search.length > 0) and if so, find the element by its text (var first = tree.findByText(search[0]);), removes the element from search (search.shift();) and finally expand the node (tree.expand(first)). This causes the next level to be loaded and when received dataBound event is triggered and I will go to the next level.

    See it running here

    EDIT: If instead of searching by text you prefer to navigate by id then add to search array the id of the different nodes and use the following treeNavigateNext function instead:

    function treeNavigateNext() {
        if (search.length > 0) {
            var first = tree.dataSource.get(search[0]);
            if (first) {
                search.shift();
                var elem = tree.findByUid(first.uid);
                tree.expand(elem);
            } 
        }
    }
    

    New running example here

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I know this exact question was asked here , but the answer didn't work
I don't know the exact words to describe this behavior in the following pages:
I don't know the exact problem. I am using flex mx:tree component in flex
So I know the exact path the node I would be attempting to remove.
I dont know the exact code i need to retrieve all of the filenames
I want to animate a view like UIViewAnimationTransitionCurlUp . I don't know the exact
I have used this code to animate the circle along a fixed custom route
I know this exact question has been asked , but the solution posted there
I want to know exact , whether should I used parcelable or serialization technique
I need to know the exact difference between: <form method=POST action=https://mywebsite/signon.php> <input name=harv_acc value=940322903

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.