5 Answers, 1 is accepted
Hello,
he Chat widget itself does not support DataSource binding. Nevertheless, you could store each message from the chant in your own custom source. Upon loading the Chat, you could render all the stored messages. To save those messages you could handle the sendMessage event of the Chat. To display them, you should use the renderMessage() method of the widget.
Here you could find a small Dojo sample demonstrating such an approach: https://dojo.telerik.com/EFuMefIn/3
Regards,
Veselin Tsvetanov
Progress Telerik
Hello,
In case the messages are "sent" by multiple users - such as when the chat is integrated with SignalR - and the user name and user identifier are stored in the message, how does the chat know to render the messages per different user?
Hi Daniel,
For such a scenario I would recommend you to carefully examine the Pear-to-pear integration article from our documentation:
https://docs.telerik.com/kendo-ui/controls/conversational-ui/chat/integrations/signalr-p-to-p
Notice the implementation of the ChatHub class in SignalR:
public class ChatHub : Hub
{
public async Task Send(object sender, string message)
{
// Broadcast the message to all clients except the sender.
await Clients.Others.SendAsync("broadcastMessage", sender, message);
}
public async Task SendTyping(object sender)
{
// Broadcast the typing notification to all clients except the sender.
await Clients.Others.SendAsync("typing", sender);
}
}
It should be implemented to broadcast messages and typings only to the Others clients in the SignalR hub. That logic should be handled bu the hub and not by the Chat itself.
As a side note, in case you have any other questions which are not directly related to the original topic of the current thread ("chat datasource?"), please open a separate ticket for each of them. This way we will be able to keep each thread focused and to provide you with the most appropriate assistance on each case.
Regards,
Veselin Tsvetanov
Progress Telerik
Hi Dale,
I am not quite sure I understand correctly your question. What do you mean by "keep all chat in one place"? May I ask you to elaborate a bit on that?
Regards,
Veselin Tsvetanov
Progress Telerik
Love the Telerik and Kendo UI products and believe more people should try them? Invite a fellow developer to become a Progress customer and each of you can get a $50 Amazon gift voucher.