destroy
Destroys the Chat component and cleans up all resources.
Example
<div id="chat"></div>
<script>
let messagesData = [
{
id: 1,
text: "This chat will be destroyed after 3 seconds to demonstrate the destroy method.",
authorId: "user1",
authorName: "John Doe",
authorImageUrl: "https://demos.telerik.com/kendo-ui/content/web/Customers/RICSU.jpg",
timestamp: new Date(2026, 0, 1, 9, 0)
},
{
id: 2,
text: "You'll see the chat component disappear when destroy() is called.",
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)
}
];
let chat = $("#chat").kendoChat({
authorId: "user1",
dataSource: messagesData
}).data("kendoChat");
// Destroy the chat after 3 seconds
setTimeout(function() {
chat.destroy();
}, 3000);
</script>
In this article