This example shows the client-side events supported by Telerik TreeView for ASP.NET MVC.
The treeview has the following events:
In addition, the following events are raised when the drag&drop mode is enabled:
You can subscribe to each of the events in the following ways:
<%= Html.Telerik().TreeView()
.Name("TreeView")
.ClientEvents(events => events
.OnSelect("onSelect")
)
%>
<script type="text/javascript">
function onSelect(e) {
// your code
}
</script>
<% Html.Telerik().TreeView()
.Name("TreeView")
.ClientEvents(events => events
.OnLoad(() =>
{%>
function(e) {
// your code
}
<%})
.Render();
%>
<%= Html.Telerik().TreeView().Name("TreeView") %>
<script type="text/javascript">
$(document).ready(function() {
$('#TreeView').bind('select', function(e) {
// your code
});
});
</script>