This is a migrated thread and some comments may be shown as answers.

program freezes when clicking on parent node

8 Answers 56 Views
TreeView
This is a migrated thread and some comments may be shown as answers.
Bill
Top achievements
Rank 2
Bill asked on 24 Aug 2010, 05:35 PM
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?

8 Answers, 1 is accepted

Sort by
0
Veronica
Telerik team
answered on 27 Aug 2010, 01:21 PM
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
0
Bill
Top achievements
Rank 2
answered on 27 Aug 2010, 03:02 PM
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?
0
Veronica
Telerik team
answered on 27 Aug 2010, 04:27 PM
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
0
Bill
Top achievements
Rank 2
answered on 27 Aug 2010, 04:43 PM
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.
0
Veronica
Telerik team
answered on 30 Aug 2010, 04:35 PM
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
0
Bill
Top achievements
Rank 2
answered on 30 Aug 2010, 05:17 PM
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?
0
Veronica
Telerik team
answered on 31 Aug 2010, 08:54 AM
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
0
Bill
Top achievements
Rank 2
answered on 31 Aug 2010, 02:52 PM
Thanks Veronica! That worked great....
Tags
TreeView
Asked by
Bill
Top achievements
Rank 2
Answers by
Veronica
Telerik team
Bill
Top achievements
Rank 2
Share this question
or