Retrieving changed data in grid edit mode

2 posts, 1 answers
  1. Kahl
    Kahl avatar
    15 posts
    Member since:
    Nov 2016

    Posted 15 Nov 2016 Link to this post

    I have a grid that has a command edit , I would like to retrieve the new text in the events.Save("onEdit")) javascript.

    I cannot see how to do this, and cannot locate any samples in the forms.


    My current function and grid is below.  How can I retrieve the data from the email address when the update button is selected in edit more.


    function onEdit(e) {
    alert("save 1");
    var grid = $("#siteManagementNotifications").data("kendoGrid");
    var tr = $("tr");
    var data = this.dataItem(tr);



    .Columns(columns =>
    columns.Bound(p => p.siteId).Title("Id").Width(50).Hidden();
    columns.Bound(p => p.siteNotificationId).Title("Id").Width(50).Hidden();
    columns.Bound(p => p.siteNotification).Title("Type").Width(50);
    columns.Bound(p => p.emailAddress).Title("Notification").Width(120).EditorTemplateName("TextBoxEditor");
    //columns.Command(command => command.Custom("Save").Click("SaveSiteNotification")).Width(180);
    columns.Command(command => { command.Edit(); }).Width(250);

    .Events(events => events.Save("onEdit"))
    .Editable(editable => editable.Mode(GridEditMode.InLine))
    .NoRecords("No notifications exist.")
    .DataSource(source => source
    .Schema(schema => schema
    .Model(m => m.Id(p => p.siteNotificationId)))
    .Transport(transport => transport
    .Read(read =>
    read.Url("/Api/SiteInfo/_getNotifications/" + Model.SiteId)

  2. Answer
    Konstantin Dikov
    Konstantin Dikov avatar
    2466 posts

    Posted 17 Nov 2016 Link to this post

    Hi Kahl,

    You can use the Save event argument for getting the new values from the edited item model:
    function onEdit(e) {

    Hope this helps.

    Konstantin Dikov
    Telerik by Progress
    Telerik UI for ASP.NET MVC is ready for Visual Studio 2017 RC! Learn more.
Back to Top