Skip to content

Commit d0a4a6c

Browse files
committed
Sync with Kendo UI Professional
1 parent d42d4f5 commit d0a4a6c

File tree

24 files changed

+1460
-256
lines changed

24 files changed

+1460
-256
lines changed
Lines changed: 79 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,79 @@
1+
---
2+
title: Events
3+
page_title: Events
4+
description: "Learn how to handle the events of the Telerik UI Diagram component for {{ site.framework }}."
5+
slug: diagram_events
6+
position: 5
7+
---
8+
9+
# Events
10+
11+
You can subscribe to [all Diagram events](https://docs.telerik.com/{{ site.platform }}/api/kendo.mvc.ui.fluent/diagrambuilder#eventssystemaction) and then use them to further customize the behavior of the Diagram.
12+
13+
For a complete example on Diagram events, refer to the [demo on using the events of the Diagram](https://demos.telerik.com/{{ site.platform }}/diagram/events).
14+
15+
### Handling by Handler Name
16+
17+
The following example demonstrates how to subscribe to events by a handler name.
18+
19+
```HtmlHelper
20+
@(Html.Kendo().Diagram()
21+
.Name("diagram")
22+
.Events(e => e
23+
.Add("onAdd")
24+
)
25+
)
26+
<script>
27+
// The Diagram instance is available as an e.sender or this.
28+
function onAdd(e) {
29+
// Handle the add event.
30+
}
31+
</script>
32+
```
33+
{% if site.core %}
34+
```TagHelper
35+
<kendo-diagram name="diagram" on-add="onAdd"></kendo-diagram>
36+
<script>
37+
// The Diagram instance is available as an e.sender or this.
38+
function onAdd(e) {
39+
// Handle the add event.
40+
}
41+
</script>
42+
```
43+
{% endif %}
44+
45+
### Handling by Template Delegate
46+
47+
The following example demonstrates how to subscribe to events by a template delegate.
48+
49+
```HtmlHelper
50+
@(Html.Kendo().Diagram()
51+
.Name("diagram")
52+
.Events(e => e
53+
.Add(@<text>
54+
function(e) {
55+
//Handle the add event inline.
56+
}
57+
</text>)
58+
)
59+
)
60+
```
61+
{% if site.core %}
62+
```TagHelper
63+
<kendo-diagram name="diagram"
64+
on-add="function(){
65+
// Handle the add event.
66+
}"
67+
</kendo-diagram>
68+
```
69+
{% endif %}
70+
71+
## Next Steps
72+
73+
* [Using the Diagram Events (Demo)](https://demos.telerik.com/{{ site.platform }}/diagram/events)
74+
75+
## See Also
76+
77+
* [Using the API of the Diagram for {{ site.framework }} (Demo)](https://demos.telerik.com/{{ site.platform }}/diagram/api)
78+
* [Diagram Server-Side API for {{ site.framework}}](/api/diagram)
79+
* [Diagram Client-Side API](https://docs.telerik.com/kendo-ui/api/javascript/ui/diagram)

0 commit comments

Comments
 (0)