Hi,
When I use the chat widget to send a message, it triggers the post event. I hope to display the User Typing Indicator using the renderUserTypingIndicator method within the onPost function, but it seems to have no effect? However, testing the renderUserTypingIndicator within $(document).ready seems to work. Have I misunderstood the usage method?
When I use the chat widget to send a message, it triggers the post event. I hope to display the User Typing Indicator using the renderUserTypingIndicator method within the onPost function, but it seems to have no effect? However, testing the renderUserTypingIndicator within $(document).ready seems to work. Have I misunderstood the usage method?
<div id="chat"></div>
<script>
$(document).ready(function () {
var chat = $("#chat").kendoChat({
post: onPost
}).data("kendoChat");
chat.renderMessage({
type: "text",
text: "Hello, how can I assist you today?",
timestamp: new Date()
}, {
name: "Chatbot"
});
function onPost(args) {
var chatargs = args.sender;
var chat = $("#chat").data("kendoChat");
// Render the typing indicator.
chat.renderUserTypingIndicator({ name: "Chatbot" });
}
});
</script>