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

Scrolls the chat message list view to the message with the specified UID. Returns true if the message was found and scrolled to, or false if the message was not found.

Parameters:uidString

The unique identifier of the message to scroll to.

Returns:Boolean

true if the message was found and scrolled to, false otherwise.

<div id="chat"></div>
<script>
let messagesData = [];
for (let i = 1; i <= 30; i++) {
    messagesData.push({
        id: i,
        text: "Message #" + i,
        authorId: i % 2 === 0 ? "user2" : "user1",
        authorName: i % 2 === 0 ? "Jane" : "John",
        timestamp: new Date(2026, 0, 1, 9, i)
    });
}

let chat = $("#chat").kendoChat({
    authorId: "user1",
    dataSource: messagesData,
    height: 400
}).data("kendoChat");

setTimeout(function() {
    let firstItem = chat.dataSource.at(0);
    if (firstItem) {
        let success = chat.scrollToMessage(firstItem.uid);
        console.log("Scrolled to message:", success);
    }
}, 1000);
</script>
Not finding the help you need?
Contact Support