This is a migrated thread and some comments may be shown as answers.

Render Attachments

4 Answers 38 Views
Chat
This is a migrated thread and some comments may be shown as answers.
Mattia
Top achievements
Rank 1
Mattia asked on 17 Oct 2018, 10:35 AM
Hello,
I'm searching a way to render attachment on a defined timestamp: in renderMessage you can specify the timestamp of the message, so will be rendered in the correct cronological history, but in renderAttachments method I cannot find the same way.

Any suggestions?
Greetings,
Mattia Thiella

4 Answers, 1 is accepted

Sort by
0
Veselin Tsvetanov
Telerik team
answered on 19 Oct 2018, 06:45 AM
Hello Mattia,

As you have correctly noted, the renderAttachments() method of the Chat widget does not accept a timestamp parameter. As far as I can understand, you are using that value for each message, when you are determining the order in which you are rendering each message (calling the renderMessage() method). Do you want to pre-define the order in which the attachments will be rendered in the same way? If this is the case, does the order in the attachments array help you to achieve that?

Here you will find a simple Dojo which demonstrates how an ordered array of attachments will be rendered in the Chat.

Regards,
Veselin Tsvetanov
Progress Telerik
Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
0
Mattia
Top achievements
Rank 1
answered on 19 Oct 2018, 07:01 AM
Ok thanks Veselin, I see that attachments inside the same carousel are rendered in order accordingly with array order.
But what I need is different, I mean is like facebook/whatsapp chat, attachments aren't rendered all in the same row, but are posted in the right position inside chat history, accordingly with their timestamp.

Maybe is just something that is not implemented in this widget.

Greetings,
Mattia
0
Mattia
Top achievements
Rank 1
answered on 19 Oct 2018, 07:03 AM

Ok thanks Veselin, I see that attachments inside the same carousel are rendered in order accordingly with array order.
But what I need is different, I mean is like facebook/whatsapp chat, attachments aren't rendered all in the same row, but are posted in the right position inside chat history, accordingly with their timestamp.
Usually this is what a user would aspect inside a modern chat

Greetings,
Mattia


0
Accepted
Veselin Tsvetanov
Telerik team
answered on 22 Oct 2018, 12:49 PM
Hello Mattia,

That is correct - attachments inside the same list will be rendered according to the order in the array they belong to. Apart from the carousel layout, the same could be observed in the list layout. Here is a modified Dojo demonstrating that.

As far as I can understand, this functionality does not fully covers what you would expect from the widget. If I get it right, you need the timestamp, so different calls of the renderAttachments() method would actually render the attachments chronologically. If this is the case, I would suggest you to log your idea as a Feature request on our Feedback portal. Based on the support it receives from the community, we will decide on whether to proceed with its implementation or not.

Regards,
Veselin Tsvetanov
Progress Telerik
Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
Tags
Chat
Asked by
Mattia
Top achievements
Rank 1
Answers by
Veselin Tsvetanov
Telerik team
Mattia
Top achievements
Rank 1
Share this question
or