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

Datasource to accept new form data

1 Answer 137 Views
Data Source
This is a migrated thread and some comments may be shown as answers.
Chris
Top achievements
Rank 2
Chris asked on 30 Mar 2020, 01:23 PM

     I have a form with a few fields. I want to take the form data and pass it to a Kendo Datasource so when I hit "Save" it will call my existing back-end JSDO class and save the data to the database. Are there examples of this anywhere?

 

I have found an example of a remote bound form to save to the back-end with an already existing DB record (ID). But my request is for new records with no ID.

https://demos.telerik.com/kendo-ui/mvvm/remote-binding

1 Answer, 1 is accepted

Sort by
0
Aleksandar
Telerik team
answered on 01 Apr 2020, 01:14 PM

Hi Chris,

To add dataItems to the dataSource you could use several methods - add, insert, pushInsert, pushCreate, depending on the behavior you would like to achieve. You could create a model based on the form inputs and add it to the dataSource with the above methods. Depending on the method used the remote dataSource would be automatically synced or would require an additional call of the sync method to save any changes.

I hope this helps. If you hade something different in mind could you please elaborate more on the scenario and provide a runnable example of the issue encountered, for example in a dojo.

Regards,
Aleksandar
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
Data Source
Asked by
Chris
Top achievements
Rank 2
Answers by
Aleksandar
Telerik team
Share this question
or