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

Save Multiple Grids in Batch Save Mode with one Button Click MVC Razor

3 Answers 361 Views
Grid
This is a migrated thread and some comments may be shown as answers.
cheng
Top achievements
Rank 1
cheng asked on 21 Sep 2016, 01:25 AM

Please assist me to do save of multiple batch grids with one Button Click MVC Razor. I have two tabs, each has its own batch edit kendo grids (one for Item and the other Supplier). I only want save button to do both updates to the database. I tried on change of Tab to call savechanges to the supplier and then bring the view back to Item. After that the Item Grid became iractic, not able to edit and it keeps falling with 'VM817:17 Uncaught TypeError: Cannot read property 'end' of undefined.' everywhere I tried calling the var grid = $('#Grid').data('kendoGrid'); it gets undefined?

How do I make it go back to the activated Grid?

Thank you.

3 Answers, 1 is accepted

Sort by
0
Pavlina
Telerik team
answered on 22 Sep 2016, 11:40 AM
Hello,

The requested functionality could be achieved using the click handler of the button and calling the sync() method of the dataSources used by the Grid widgets.
$("#saveButton").click(function() {
  $("#Grid1").getKendoGrid().dataSource.sync():
  $("#Grid2").getKendoGrid().dataSource.sync():
});

Alternatively, if you would like to have one dataSource for multiple Grids you can use the shared dataSource feature.
http://demos.telerik.com/kendo-ui/datasource/shared-datasource

Regards,
Pavlina
Telerik by Progress
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
0
cheng
Top achievements
Rank 1
answered on 06 Oct 2016, 10:14 PM

Thanks for your response, unfortunately it doesn't resolve the problem which I have just tried it. I still get undefined when it got to the

datasource.

  .on("click",
            function (e) {
                $("#Grid").getKendoGrid().dataSource.sync();
                $("#GridSupplier").getKendoGrid().dataSource.sync();

0
Pavlina
Telerik team
answered on 10 Oct 2016, 07:03 PM
Hello,

Could you isolate the problem in a sample runnable project and send it to us via support ticket so we can debug it locally and advice you further. Thank you for your cooperation in advance.

Regards,
Pavlina
Telerik by Progress
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
Tags
Grid
Asked by
cheng
Top achievements
Rank 1
Answers by
Pavlina
Telerik team
cheng
Top achievements
Rank 1
Share this question
or