Hi Friends,
I am using kendu UI grid for displaying grid.
In Grid, I need edit and delete link for each row.
$("#grid").kendoGrid({
dataSource: {
transport: {
read: "GetCompanyGroups",
contentType: "application/json; charset=utf-8",
dataType: "json"
},..............
{
template: '<a class="edit btn btn-sm btn-default" href="javascript:EditCG(#=CompanyGroupId#);"><i class="icon-note"></i></a>',
title: "Edit",
lockable: false,
width: 10
}
if i click edit, it will call the below function and retrieve the data.
here is my code:
function EditCG(id)
{
$.ajax({
type: "GET",
url: "EditCG",
data: { Id: id },
cache: false,
success: function (response) {
$("#CompanyGroupName").val(response.CompanyGroupName)
}
});
}
in My view, I am using "CompanyGroupVM" as view model.
I want to copy the response object to "company group VM"
i want to know how to copy the Json object to Viewmodel or is there any other simple function for edit in Kendo UI grid?
Regards,
Lalitha