toggleSendButtonGenerating
Toggles the send button generating state, showing a loading indicator.
Parameters
generating Boolean
Whether to show the generating state.
Example
<div id="chat"></div>
<script>
let messagesData = [
{
id: 1,
text: "Type a message and see the send button change to a loading state.",
authorId: "bot",
authorName: "Chat Bot",
authorImageUrl: "https://demos.telerik.com/kendo-ui/content/web/Customers/RICSU.jpg",
timestamp: new Date(2026, 0, 1, 9, 0)
},
{
id: 2,
text: "The generating state is useful for AI chat applications.",
authorId: "user",
authorName: "User",
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: "user",
dataSource: messagesData
}).data("kendoChat");
// Toggle generating state every 3 seconds to demonstrate
let isGenerating = false;
setInterval(function() {
isGenerating = !isGenerating;
chat.toggleSendButtonGenerating(isGenerating);
console.log("Send button generating state:", isGenerating);
}, 3000);
</script>
In this article