contextMenuAction

Fired when a message context menu action is executed. This event allows you to handle custom message actions and respond to user interactions with message context menus.

Event Data

e.type String

The type of context menu action that was executed.

e.message Object

The message object associated with the action.

Example

<div id="chat"></div>
<script>
let messagesData = [
    {
        id: 1,
        text: "This is a sample message with context menu actions.",
        authorId: "support",
        authorName: "Support Agent",
        timestamp: new Date(2026, 0, 1, 9, 0)
    }
];

$("#chat").kendoChat({
    authorId: "user",
    dataSource: messagesData,
    messageActions: [
        { name: "reply", text: "Reply", icon: "undo" },
        { name: "forward", text: "Forward", icon: "share" },
        { name: "bookmark", text: "Bookmark", icon: "star" }
    ],
    contextMenuAction: function(e) {
        console.log("Context menu action executed:", e.type);
        console.log("On message:", e.message.text);
        
        if (e.type === "forward") {
            alert("Forwarding message: " + e.message.text);
        } else if (e.type === "bookmark") {
            alert("Bookmarked message: " + e.message.text);
        }
    }
});
</script>
In this article
contextMenuAction
Not finding the help you need?
Contact Support