When a user selects a row in my grid, I can get the dataItem from a button click as follows:
$("#viewApplicationBtn").on("click", function () {
var grid = $("#Grid").data("kendoGrid");
var gridData = grid.dataItem(grid.select());
What I would like to do from this point is post this back to my controller, let the MVC model binder map to my ViewModel, and then redirect to another view which is of that model type.
The roadblock I'm facing is that an ajax post won't accomplish this and I can't pass the properties in a Url.Action helper because there are too many
here is my ajax:
$.ajax({
type: "POST",
url: "@Url.Action("ValidateModel")",
datatype: "json",
contentType: "application/json",
data: JSON.stringify(gridData),
success: function(data) {
window.location.href = @Url.Action("Details", "GridController");
},
error: function(data) {
console.log("post failed");
}
});
So how can I use my grid selection to post to another view with a Model?