setOptions

Sets new options for the Chat component and reinitializes components as needed.

Parameters

options Object

The new configuration options.

Example

<div id="chat"></div>
<script>
let messagesData = [
    {
        id: 1,
        text: "This chat will change its height and message width mode after 3 seconds.",
        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: "Watch how the appearance changes when setOptions 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,
    height: 400,
    messageWidthMode: "standard"
}).data("kendoChat");

// Change options after 3 seconds
setTimeout(function() {
    chat.setOptions({
        height: 500,
        messageWidthMode: "full"
    });
    console.log("Chat options updated!");
}, 3000);
</script>
In this article
setOptions
Not finding the help you need?
Contact Support