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

Timeline adding Event on Button Click

1 Answer 78 Views
Timeline
This is a migrated thread and some comments may be shown as answers.
Amit
Top achievements
Rank 1
Amit asked on 07 Apr 2020, 10:21 PM

Hello,

I am trying to to use Timeline to build a conditional survey, where the questions are not known in advance. Expectation is each answer will be added to the Timeline and will be visible to the user.

I am not able to understand how to use Timeline to add the Events as the question is answered. I am using Jquery with .net Core.

Best Regards

1 Answer, 1 is accepted

Sort by
0
Tsvetomir
Telerik team
answered on 09 Apr 2020, 12:00 PM

Hi Amit,

In general, the Kendo UI Timeline is a widget primarily used for visualization of data. If you would like to add new items, I would recommend making use of the underlying data source of the widget. More specifically using the insert() method:

$("#timeline").getKendoTimeline().dataSource.insert({title:"newly added", description: "description", date:new Date()})

If you would like to save the changes, you should configure the transport.create and schema.model.id options of the data source:

After inserting the item, call the sync method in order to send a request to the server-side and save the new item in the database:

https://docs.telerik.com/kendo-ui/api/javascript/data/datasource/methods/sync

 

Regards,
Tsvetomir
Progress Telerik

Progress is here for your business, like always. Read more about the measures we are taking to ensure business continuity and help fight the COVID-19 pandemic.
Our thoughts here at Progress are with those affected by the outbreak.
Tags
Timeline
Asked by
Amit
Top achievements
Rank 1
Answers by
Tsvetomir
Telerik team
Share this question
or