Events
You can subscribe to all TreeMap events.
Handling Events by Handler Name
The following example demonstrates how to subscribe to events by a handler name.
@(Html.Kendo().TreeMap()
.Name("treemap")
.Events(events => events
.ItemCreated("onItemCreated")
.DataBound("onDataBound")
)
)
@addTagHelper *, Kendo.Mvc
<kendo-treemap name="treemap"
on-item-created="onItemCreated"
on-data-bound="onDataBound">
</kendo-treemap>
<script>
function onItemCreated(e) {
// The HTML element.
var element = e.element;
// The dataItem to which the element is bound.
var dataItem = e.sender.dataItem(e.element);
}
function onDataBound(e) {
// Handle the dataBound event.
}
</script>
Handling Events by Template Delegate
The following example demonstrates how to subscribe to events by a template delegate.
@(Html.Kendo().TreeMap()
.Name("treemap")
.Events(e => e
.ItemCreated(@<text>
function(e) {
// The HTML element.
var element = e.element;
// The dataItem to which the element is bound.
var dataItem = e.sender.dataItem(e.element);
}
</text>)
.DataBound(@<text>
function(e) {
// Handle the dataBound event.
}
</text>)
)
)