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

4 posts, 0 answers
  1. cheng
    cheng avatar
    3 posts
    Member since:
    Aug 2015

    Posted 20 Sep Link to this post

    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.

  2. Pavlina
    Admin
    Pavlina avatar
    6084 posts

    Posted 22 Sep Link to this post

    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
  3. UI for ASP.NET MVC is VS 2017 Ready
  4. cheng
    cheng avatar
    3 posts
    Member since:
    Aug 2015

    Posted 06 Oct in reply to Pavlina Link to this post

    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();

  5. Pavlina
    Admin
    Pavlina avatar
    6084 posts

    Posted 10 Oct Link to this post

    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
Back to Top
UI for ASP.NET MVC is VS 2017 Ready