I need to pass kendo grid model (on save event) to the server side in an ajax call. How can i do that? Tried the following
function onSave(e) {
var keys = Object.keys(e.values);
var colName = keys[0];
var alignment;
var mapHeaderId = $('#ddlMaps').val();
var yearId = $('#ddlYear').val();
$.get("@Url.Action("CalculateFormattingForResult", "Maps")", { studentId: e.model.studentid, colId: colName, value: e.values[colName], mapHeaderId: mapHeaderId, yearId: yearId,
model: JSON.stringify(e.model)
}, function (data) {}
}
My C# code is
public string CalculateFormattingForResult(int studentId, string colId, string value, int mapHeaderId, int yearId, string model) {
}
If someone is interested into why i am doing that..is because i need to get the latest edited values in the grid based on which i have to calculate/update other values in the grid.
UPDATE
I tried it with $.post and it worked but with post the problem is that probably i can only submit the form once however, i am only doing data validation on edit event of each cell...so i need to do it again and again. so my question is still there... how do i pass json string which is [kendo dataItem (row)] in ajax??