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

Dynamic form with Template And Model

2 Answers 553 Views
Templates
This is a migrated thread and some comments may be shown as answers.
Moshe Hayun
Top achievements
Rank 1
Moshe Hayun asked on 03 Sep 2017, 09:33 AM

Hello,

I would like to have the opinion of Kendo experts on the following subject.
I would like to create a kind of form that would check if certain conditions are met in order to continue an operation. The conditions are defined in a table as a string text (for example, "Filled the registration form", "Paid the registration fee" and so on ...). It's also possible to have several form one after the other in the case where several operations are in progress simultaneously. In addition, there are two Save and Cancel buttons in each form. I made a small sketch in order to picture this (attached file Dynamic Form.png)

 

My Controller returns a list of objects like this:

  1. Definition Label #1
    • 1st Checking
    • 2nd Checking
    • 3rd Checking
  2. Definition Label #2 (1st checking) ...

My question would be: There is a Kendo component that could help me achieve this optimally?
I managed to fill the form etc ... with jQuery, but when I had to realize the code behind for the buttons, I thought there might be a simpler way. Because I need two things mainly:
When clicking on the Save button, find out the value for each of the checks for each of the forms. And navigating through the DOM to get this info is somewhat tedious ...
When clicking Cancel, reset the displayed values to those received by the Controller.
Having already used Keno for Grid / ComboBox, I would like to know if there was anything that could help me in this case. (Kendo Template and a Model for example?)

2 Answers, 1 is accepted

Sort by
0
Accepted
Ianko
Telerik team
answered on 05 Sep 2017, 11:29 AM

Hello DevHM,

Yes, you can use the Kendo MVVM binder to accomplish some of the requirements. But still you will need to implement some code that will accomplish exactly what you need. 

You can check out this blog post from Falafel, that demonstrates how to build up a dynamic form out of JSON fetched from the server: https://blog.falafel.com/kendo-ui-creating-an-dynamic-input-form-from-an-external-json-viewmodel/

Regards,
Ianko
Progress Telerik
Try our brand new, jQuery-free Angular 2 components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
0
Moshe Hayun
Top achievements
Rank 1
answered on 16 Oct 2017, 07:38 AM
Thank you Ianko for your answer. I had a look and it helped me. 
Tags
Templates
Asked by
Moshe Hayun
Top achievements
Rank 1
Answers by
Ianko
Telerik team
Moshe Hayun
Top achievements
Rank 1
Share this question
or