filesTemplateFunction
The template that is used to render the files in the message box when selected.
Example
<div id="chat"></div>
<script>
let messagesData = [
{
id: 1,
text: "Here are some files with custom rendering:",
authorId: "user1",
authorName: "John Doe",
authorImageUrl: "https://demos.telerik.com/kendo-ui/content/web/Customers/RICSU.jpg",
files: [
{ name: "report.pdf", size: 245760, extension: "pdf" },
{ name: "image.jpg", size: 156000, extension: "jpg" }
],
timestamp: new Date(2026, 0, 1, 9, 0)
},
{
id: 2,
text: "The files look different with the custom template!",
authorId: "user2",
authorName: "Jane Smith",
authorImageUrl: "https://demos.telerik.com/kendo-ui/content/web/Customers/LONEP.jpg",
timestamp: new Date(2026, 0, 1, 9, 5)
}
];
$("#chat").kendoChat({
filesTemplate: function(files, downloadAll, messages, closeButton) {
// Custom file rendering logic
return "<div class='custom-files'><strong>Custom Files:</strong> " + files.length + " file(s)</div>";
},
authorId: "user2",
dataSource: messagesData
});
</script>
In this article