New to Kendo UI for jQueryStart a free 30-day trial

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

Event Data

e.type String

The type of file action that was executed.

e.file Object

The file object associated with the action.

e.message Object

The message object containing the file.

<div id="chat"></div>
<script>
let messagesData = [
    {
        id: 1,
        text: "Here's the document you requested:",
        authorId: "support",
        authorName: "Support Agent",
        timestamp: new Date(2026, 0, 1, 9, 0),
        files: [{
            uid: "file1",
            name: "document.pdf",
            size: 1024576,
            type: "application/pdf",
            url: "https://example.com/document.pdf"
        }]
    }
];

$("#chat").kendoChat({
    authorId: "user",
    dataSource: messagesData,
    fileActions: [
        { name: "download", text: "Download", icon: "download" },
        { name: "preview", text: "Preview", icon: "eye" }
    ],
    fileMenuAction: function(e) {
        console.log("File action executed:", e.type);
        console.log("On file:", e.file.name);

        if (e.type === "preview") {
            alert("Previewing file: " + e.file.name);
        }
    }
});
</script>
Not finding the help you need?
Contact Support