New to Telerik UI for ASP.NET MVC? Download free 30-day trial

ChatEventBuilder

Methods

ActionClick(System.String)

Fired when an action button is clicked inside an attachment template, or when a suggestedAction is clicked.

For more information see ActionClick event.

Parameters

handler - System.String

The name of the JavaScript function that will handle the actionClick event.

Example


                   @(Html.Kendo().Chat()
                         .Name("chat")
                         .Events(events => events.ActionClick("onActionClick"))
                   )

ActionClick(System.Func)

Fired when an action button is clicked inside an attachment template, or when a suggestedAction is clicked.

For more information see ActionClick event.

Parameters

handler - System.Func<Object,Object>

The handler code wrapped in a text tag.

Example


                @(Html.Kendo().Chat()
                      .Name("chat")
                      .Events(events => events.ActionClick(
                           @<text>
                           function(e) {
                               // event handling code
                           }
                           </text>
                      ))
                )

Post(System.String)

Fired when a message is posted to the chat widget. This can be either through the message box, or an action button click.

For more information see Post event.

Parameters

handler - System.String

The name of the JavaScript function that will handle the post event.

Example


               @(Html.Kendo().Chat()
                     .Name("chat")
                     .Events(events => events.Post("onPost"))
               )

Post(System.Func)

Fired when a message is posted to the chat widget. This can be either through the message box, or an action button click.

For more information see Post event.

Parameters

handler - System.Func<Object,Object>

The handler code wrapped in a text tag.

Example


                @(Html.Kendo().Chat()
                      .Name("chat")
                      .Events(events => events.Post(
                           @<text>
                           function(e) {
                               // event handling code
                           }
                           </text>
                      ))
                )

SendMessage(System.String)

Fired when a message is posted through the chat message box.

For more information see SendMessage event.

Parameters

handler - System.String

The name of the JavaScript function that will handle the sendMessage event.

Example


               @(Html.Kendo().Chat()
                     .Name("chat")
                     .Events(events => events.SendMessage("onSendMessage"))
               )

SendMessage(System.Func)

Fired when a message is posted through the chat message box.

For more information see SendMessage event.

Parameters

handler - System.Func<Object,Object>

The handler code wrapped in a text tag.

Example


                @(Html.Kendo().Chat()
                      .Name("chat")
                      .Events(events => events.SendMessage(
                           @<text>
                           function(e) {
                               // event handling code
                           }
                           </text>
                      ))
                )

TypingEnd(System.String)

Fired when the user clears the chat message box, signaling that he stopped typing. The event is also triggered when the user submits the currenlty typed in message.

For more information see TypingEnd event.

Parameters

handler - System.String

The name of the JavaScript function that will handle the typingEnd event.

Example


               @(Html.Kendo().Chat()
                     .Name("chat")
                     .Events(events => events.TypingEnd("onTypingEnd"))
               )

TypingEnd(System.Func)

Fired when the user clears the chat message box, signaling that he stopped typing. The event is also triggered when the user submits the currenlty typed in message.

For more information see TypingEnd event.

Parameters

handler - System.Func<Object,Object>

The handler code wrapped in a text tag.

Example


                @(Html.Kendo().Chat()
                      .Name("chat")
                      .Events(events => events.TypingEnd(
                           @<text>
                           function(e) {
                               // event handling code
                           }
                           </text>
                      ))
                )

TypingStart(System.String)

Fired when the user starts typing in the chat message box. The event is fired only once, and not upon each keystroke.

For more information see TypingStart event.

Parameters

handler - System.String

The name of the JavaScript function that will handle the typingStart event.

Example


               @(Html.Kendo().Chat()
                     .Name("chat")
                     .Events(events => events.TypingStart("onTypingStart"))
               )

TypingStart(System.Func)

Fired when the user starts typing in the chat message box. The event is fired only once, and not upon each keystroke.

For more information see TypingStart event.

Parameters

handler - System.Func<Object,Object>

The handler code wrapped in a text tag.

Example


                @(Html.Kendo().Chat()
                      .Name("chat")
                      .Events(events => events.TypingStart(
                           @<text>
                           function(e) {
                               // event handling code
                           }
                           </text>
                      ))
                )

ToolClick(System.String)

Fired when the user clicks on a tool in the toolbar.

For more information see ToolClick event.

Parameters

handler - System.String

The name of the JavaScript function that will handle the toolClick event.

Example


                @(Html.Kendo().Chat()
                       .Name("chat")
                       .Toolbar(toolbar =>
                       {
                           toolbar.Toggleable(true);
                           toolbar.Buttons(buttons =>
                           {
                               buttons.Add().Name("sendimage").IconClass("k-icon k-i-image");
                           });
                       })
                       .Events(e =>
                       {
                           e.ToolClick("onToolClick");
                       })
                )

ToolClick(System.Func)

Fired when the user clicks on a tool in the toolbar.

For more information see ToolClick event.

Parameters

handler - System.Func<Object,Object>

The handler code wrapped in a text tag.

Example


                @(Html.Kendo().Chat()
                       .Name("chat")
                       .Toolbar(toolbar =>
                       {
                           toolbar.Toggleable(true);
                           toolbar.Buttons(buttons =>
                           {
                               buttons.Add().Name("sendimage").IconClass("k-icon k-i-image");
                           });
                       })
                       .Events(events => events.ToolClick(
                           @<text>
                           function(e) {
                               // event handling code
                           }
                           </text>
                      ))
                )

In this article
Not finding the help you need?