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) {
e.preventDefault();
alert("save 1");
var grid = $("#siteManagementNotifications").data("kendoGrid");
var tr = $(e.target).closest("tr");
var data = this.dataItem(tr);
alert(data.emailAddress);
}
@(Html.Kendo().Grid<WebSite.Library.Models.SiteNotifications>()
.Name("siteManagementNotifications")
.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
.Custom()
.Schema(schema => schema
.Model(m => m.Id(p => p.siteNotificationId)))
.Transport(transport => transport
.Read(read =>
{
read.Url("/Api/SiteInfo/_getNotifications/" + Model.SiteId)
.DataType("json");
})
))
)