Grid how to save changes from dropdownlist editor

3 posts, 0 answers
  1. Joe
    Joe avatar
    5 posts
    Member since:
    May 2013

    Posted 08 Mar 2015 Link to this post

    I have been looking through the examples, but am failing to see how to save the changes back to the server via a custom dropdownlist in my grid.

    I am able to get the dropdownlist in the grid and select it from edit mode. Now based on my select I would like to save the changes based on the row record selected.

    Is there an example using a template or a full example of this somewhere. Everything I have seen so far has been partial examples.

    Here is my editor function which works fine with my grid, just need to know how to make an ajax call or where to make the call to save the change.

        function internalStatusDropDownEditor(container, options) {
            $('<input required data-text-field="InternalStatus" data-value-field="InternalStatus" data-bind="value:' + options.field + '"/>')
                .appendTo(container)
                .kendoDropDownList({
                    autoBind: false,
                    dataSource: {
                        data: [{ InternalStatus: "Open" }, { InternalStatus: "Closed" }, { InternalStatus: "Pending Input" }]
                    }
                });
        }

    Thanks all.

  2. Rosen
    Admin
    Rosen avatar
    3234 posts

    Posted 11 Mar 2015 Link to this post

    Hi Joe,

    It is not clear what you are trying to achieve. Do you want to save the changes when the DropDownList value is changed? If this is the case you could use the change event to the DropDownList to call the DataSource associated with the Grid sync method. This will push the change to the server (if DataSource is correctly configured).

    .kendoDropDownList({        
      change: function() {
        var dataSource = $("#grid").getKendoGrid().dataSource;             
        dataSource.sync();
      },
      dataSource: {
         //...
      }         
    });


    Regards,
    Rosen
    Telerik
     
    Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
     
  3. Kendo UI is VS 2017 Ready
  4. Joe
    Joe avatar
    5 posts
    Member since:
    May 2013

    Posted 11 Mar 2015 in reply to Rosen Link to this post

    Thank you for your reply. I will look further into the DataSource documentation to get it configured correctly to push back to the server.

    Any additional links or examples on that portion are always appreciated.

Back to Top