program freezes when clicking on parent node

9 posts, 0 answers
  1. Bill
    Bill avatar
    175 posts
    Member since:
    Apr 2010

    Posted 24 Aug 2010 Link to this post

    I have an OnNodeclick event that gets fired when clicking on a child node in a treeview. This works fine. When I click on the + sign of a parent node, everything is fine. It expands it so I can see the child nodes & vice-versa. The problem occurs when I actually click on the parent node itself. No action occurs and my application freezes up.

    It doesn't even get into the OnNodeClick event for the Treeview.

    How do I resolve this behavior when simply just clicking on the parent node itself?
  2. Veronica
    Admin
    Veronica avatar
    1213 posts

    Posted 27 Aug 2010 Link to this post

    Hi William Yeager,

    I tried to reproduce your case but to no avail.
    In the ticket info I see you are using version 2010.2.713. Is that true?
    Could you please try to isolate the case to sample page and send it?
    Thank you!

    Best wishes,
    Veronica Milcheva
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Bill
    Bill avatar
    175 posts
    Member since:
    Apr 2010

    Posted 27 Aug 2010 Link to this post

    Veronica, I am using version 2009.3.1314.35 of the Telerik tools.

    This only happens with IE when debugging within VS 2008. It's fine with Firefox or Chrome.

    Any ideas?
  5. Veronica
    Admin
    Veronica avatar
    1213 posts

    Posted 27 Aug 2010 Link to this post

    Hi William Yeager,

    Thank you for the further details although the result is same - NodeClick event fires.

    Did you set a NavigateUrl to the root node?

    It will be very helpful if you can send me a sample page which demonstrates the bug.

    Greetings,
    Veronica Milcheva
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
  6. Bill
    Bill avatar
    175 posts
    Member since:
    Apr 2010

    Posted 27 Aug 2010 Link to this post

    Veronica, the node click is not supposed to fire if you click directly on the parent node. I don't have a url property associated with it. I have a tree that if you simply click on the child nodes, it will fire the onclick event and my normal processing occurs.

    If you click the + sign on the parent nodes, it opens up its child nodes.

    However, if you click directly on the parent node text, that's when it freezes up using IE. I would expect no action to take place whatsoever.
  7. Veronica
    Admin
    Veronica avatar
    1213 posts

    Posted 30 Aug 2010 Link to this post

    Hi William,

    You can subscribe to the OnClientNodeClicking event, check the level of the node and if it is 0 (e.g the node is root) - cancel the event. Here's the code for this:

    function clientNodeClicking(sender, args) {
               var node = args.get_node();
               if (node.get_level() == 0) {
                   args.set_cancel(true);
               }
           }

    Hope this helps.

    Regards,
    Veronica Milcheva
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
  8. Bill
    Bill avatar
    175 posts
    Member since:
    Apr 2010

    Posted 30 Aug 2010 Link to this post

    Veronica, that's fine for parent nodes, but I also have sub nodes which are also parent nodes. I do know, however, that all of my parent nodes have a forecolor of blue.

    How could I accomplish the same methodolgy of checking if the forecolor is blue instead of if the level is 0?
  9. Veronica
    Admin
    Veronica avatar
    1213 posts

    Posted 31 Aug 2010 Link to this post

    Hi William Yeager,

    Well, if I understood correctly your problem, you need to disable execution of the NodeClick event if it's thrown for a node having children, right?
    If this is your case, you can just check if the node has children or not. For example you can handle the same event ClientNodeClicking like this:

    function clientNodeClicking(sender, args) {
        var node = args.get_node();
        if (node.get_nodes().get_count() > 0) {
            args.set_cancel(true);
        }
    }

    Hope this is going to help you!

    Greetings,
    Veronica Milcheva
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
  10. Bill
    Bill avatar
    175 posts
    Member since:
    Apr 2010

    Posted 31 Aug 2010 Link to this post

    Thanks Veronica! That worked great....
Back to Top
UI for ASP.NET Ajax is Ready for VS 2017