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

Partial templated node highlight and selection

4 Answers 51 Views
TreeView
This is a migrated thread and some comments may be shown as answers.
JustinWong
Top achievements
Rank 1
JustinWong asked on 08 Oct 2009, 06:00 PM
Hi:

My treeview has templated nodes with 2 labels in it: one below the other (id=Label01 and Label02).  Currently, when the mouse hoovers over the node, both lines / labels are highlighted. Is there a way to for me to refine that, so:

If the mouse hoovers over the first label / line, then only that line is highlighted? 

Also, if the user clicks on the node, how can I capture whether the user clicked on Label01 or Label02?

Many thanks in advance for you help!

Justin

4 Answers, 1 is accepted

Sort by
0
Accepted
Yana
Telerik team
answered on 12 Oct 2009, 12:21 PM
Hello Justin,

Please find attached your modified page demonstrating the needed approach.

Best wishes,
Yana
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
0
JustinWong
Top achievements
Rank 1
answered on 12 Oct 2009, 05:11 PM

But how can I make the node jump off the page and kiss me?

 

Just kidding. You folks are SO GOOD, it's unbelieveable!

 

Justin

0
JustinWong
Top achievements
Rank 1
answered on 09 Nov 2009, 02:29 AM
Hi Yana:

Okay. I need help on another issue with this scenario:

So, the template node has 2 labels, just like before.  Now, I have a RadTreeViewContextMenu built into the TreeView.

Is there away to show the context menu ONLY when the user right-click on Label01 and NOT when the user right-click on Label02?  I am guesssing that this is done within the ClientContextMenuShowing function? Somehow, within this function, I test with Label the user right-click on and if it is Label02, then I cancel out of the function? 

But I don't know how to test which Label the user right-clicked within this function. Can you please help me?

Thanks again!

Justin
0
Yana
Telerik team
answered on 12 Nov 2009, 08:38 AM
Hi Justin,

ClientContextMenuShowing event will definitily do the work in this case, you can find which label is right-clicked in the same way as in OnClientNodeClicked event:

function contextMenuShowing(sender, args) {
    if (!(args.get_domEvent().target.id.indexOf("ItemLabel") > -1))
        args.set_cancel(true);
}

I've attached the modified page for a reference.

Kind regards,
Yana
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
Tags
TreeView
Asked by
JustinWong
Top achievements
Rank 1
Answers by
Yana
Telerik team
JustinWong
Top achievements
Rank 1
Share this question
or