Button to Save Form and Kendo Grid

6 posts, 0 answers
  1. Desenvolvimento Ingresso
    Desenvolvimento Ingresso avatar
    6 posts
    Member since:
    Oct 2013

    Posted 06 Feb 2014 Link to this post

    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
  2. Dimo
    Admin
    Dimo avatar
    8478 posts

    Posted 10 Feb 2014 Link to this post

    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!
  3. Desenvolvimento Ingresso
    Desenvolvimento Ingresso avatar
    6 posts
    Member since:
    Oct 2013

    Posted 10 Feb 2014 Link to this post

    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.
  4. Dimo
    Admin
    Dimo avatar
    8478 posts

    Posted 11 Feb 2014 Link to this post

    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!
  5. Stephanie
    Stephanie avatar
    2 posts
    Member since:
    May 2017

    Posted 12 Jul 2018 Link to this post

    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. 

     

  6. Konstantin Dikov
    Admin
    Konstantin Dikov avatar
    2466 posts

    Posted 16 Jul 2018 Link to this post

    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.
Back to Top