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

Button to Save Form and Kendo Grid

5 Answers 725 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Desenvolvimento Ingresso
Top achievements
Rank 1
Desenvolvimento Ingresso asked on 06 Feb 2014, 09:40 PM
Hello, good evening 

Your solution solved my previous thanks problem. 

Now, I came to another problem: 

I have a Group entity, which will be displayed in a form where it can be edited. 

Below, have a kendo grid where the local group that appears in the case 1 to N. 

The problem is this, I need to have a single "Save" button to update the Group (Form) and Local (Grid) that group at the same time. 

Could you help me this time? 

Thank you

5 Answers, 1 is accepted

Sort by
0
Dimo
Telerik team
answered on 10 Feb 2014, 09:47 AM
Hello Marcel,

I suppose you are using Ajax. In this case you should do the following:

1. Submit the information, which is outside the Grid.
2. Rebind the Grid in the success event of the Ajax request.

http://docs.telerik.com/kendo-ui/api/web/grid#fields-dataSource

http://docs.telerik.com/kendo-ui/api/framework/datasource#methods-read

This algorithm will ensure that the Grid is refreshed with the new data, otherwise there is no guarantee about that.

If needed, you can display an Ajax loader over the Grid as soon as you perform the request from point (1). 

http://docs.telerik.com/kendo-ui/api/web/ui#methods-progress

Since the Grid will display the same animated loader automatically over its data area, you can use the following approach to avoid seeing two different loading indicators.

kendo.ui.progress($("#YourGridID > .k-grid-content"), true);


Regards,
Dimo
Telerik
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
0
Desenvolvimento Ingresso
Top achievements
Rank 1
answered on 10 Feb 2014, 12:36 PM
I guess I did not express myself correctly, the problem is that I do not know how to pass data from the form and the data kendo grid for the same method, ie when you click the save button, call the update method of the form with the data and data grid.
0
Dimo
Telerik team
answered on 11 Feb 2014, 09:26 AM
Hello Marcel,

What do you mean by

"I do not know how to pass data from the form and the data kendo grid for the same method"

What data exactly from the Grid you want to pass? In general, you should be aware of the following:

+ how to obtain reference to the Kendo UI Model associated with a given table row
http://docs.telerik.com/kendo-ui/api/web/grid#methods-dataItem

+ how to obtain reference to the Grid dataSource instance
http://docs.telerik.com/kendo-ui/api/web/grid#fields-dataSource

+ all the methods the DataSource provides for retrieving data (get(), view(), etc)
http://docs.telerik.com/kendo-ui/api/framework/datasource

Regards,
Dimo
Telerik
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
0
Stephanie
Top achievements
Rank 1
answered on 12 Jul 2018, 04:48 PM

It would be great if someone could actually answer the question he is asking. I have been having trouble with this in MVC since there is no way to bind batch grid data to the model in the view. 

 

0
Konstantin Dikov
Telerik team
answered on 16 Jul 2018, 08:00 AM
Hi Stephanie,

You can refer to the following HowTo example for posting Grid data with a Form:
Note that you need to create templates with hidden inputs for each cell, so that the values from those input elements will be submitted with the form.

Hope this helps.


Regards,
Konstantin Dikov
Progress Telerik
Try our brand new, jQuery-free Angular components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
Tags
Grid
Asked by
Desenvolvimento Ingresso
Top achievements
Rank 1
Answers by
Dimo
Telerik team
Desenvolvimento Ingresso
Top achievements
Rank 1
Stephanie
Top achievements
Rank 1
Konstantin Dikov
Telerik team
Share this question
or