I have a RadPanel that hosts a few items. One of the items is a Help section where I am trying to simulate the standard help format with a Splitter showing two panels, a left and a right. The left has a RadTreeView and the right has an asp:Literal control.
My plan is to load a hierarcy of help topics based on a URL that is recorded in the help table. So the table has a ParentID column that will hold a value or not. This sets up the grouping of the tree view nodes
.
I also want to have JavaScript load the content of the selected help topic (RadTreeNode) into the literal control's text property when the node is clicked. Researching it on this site had given me the JavaScript via a RadScript block to respond to click events, focus, etc.
This is a MVC application with a Master Page and the View is displaying an MVC user control that is wrapping the Help process. So the RadPanelBar displays the help section item as a user control. All the JavaScript and styles are in the UserControl markup.
So I am not able to do the following things in JavaScript:
My plan is to load a hierarcy of help topics based on a URL that is recorded in the help table. So the table has a ParentID column that will hold a value or not. This sets up the grouping of the tree view nodes
.
I also want to have JavaScript load the content of the selected help topic (RadTreeNode) into the literal control's text property when the node is clicked. Researching it on this site had given me the JavaScript via a RadScript block to respond to click events, focus, etc.
This is a MVC application with a Master Page and the View is displaying an MVC user control that is wrapping the Help process. So the RadPanelBar displays the help section item as a user control. All the JavaScript and styles are in the UserControl markup.
So I am not able to do the following things in JavaScript:
- Get the Literal Control instance (this is nested in a RadPane.
- Get the RadTreeView instance.
- Get the selected node.
- Get the object databound to the node.
- Set the Text property of the Literal Control to the "Content" property of my help business object.
This is the only thing I have been successful with to get the Literal object...
function
onNodeClicking(sender, args)
{
alert(
"OnClientNodeClicking: "
+ args.get_node().get_text()); <-- works
var
literalContent = $(
'#helpContentHolder'
); <-- returns generic object, how to cast?
var
tree = <%= ctrlHelpRadTreeView.ClientID %>; <-- returns HTMLDivElement ??
}
All the client side events below are in place and working...
<
telerik:RadTreeView
ID
=
"ctrlHelpRadTreeView"
runat
=
"server"
CheckBoxes
=
"True"
AllowNodeEditing
=
"True"
EnableDragAndDrop
=
"true"
OnClientNodeClicking
=
"onNodeClicking"
OnClientNodeChecking
=
"onNodeChecking"
OnClientMouseOver
=
"onMouseOver"
OnClientMouseOut
=
"onMouseOut"
OnClientNodeEditStart
=
"onEditStart"
OnClientNodeEditing
=
"onEditing"
OnClientNodeEdited
=
"onEdited"
OnClientNodeDragStart
=
"onNodeDragStart"
OnClientNodeDropping
=
"onNodeDropping"
OnClientNodeExpanded
=
"onNodeExpanded"
OnClientNodeCollapsed
=
"onNodeCollapsed"
OnClientNodeAnimationEnd
=
"onNodeAnimationEnd"
OnClientLoad
=
"onLoad"
BeforeClientClick
=
"BeforeClientClickHandler"
Width
=
"100%"
Height
=
"250px"
Style
=
"border: 1px solid #CBE7F5;"
>
.........
</
telerik:RadTreeView
>
So the handler I am anticipating and have been working with is the OnNodeClicked.
Can anyone shed some light on how I get the literal and set it's text to the databound object in the TreeView?
The attached file shows how I am adapting it from a demo here on the site. The TreeView is not databound at this time. The image is intended to show the two panes side by side (again, inside the user control). The Literal control is visible in the right panel inside the user control.
Thanks!
Reid