I am trying to build an ASP.NET 4 MVC web service using kendo UI in which I have the following requirements
1. posting data in a kendo Window. The kendo Window will contain a form. (I am trying to achieve this using iframe.)
2. and retrieving back the updated data from the form.
Home.cshtml
<div id="actionFormWindow"></div>
TriageForm.cshtml
@model BugViewModel
<form>
//display the model data
</form>
<button class="k-button" id="okButton">Ok</button>
<button class="k-button" id="cancelButton">Cancel</button>
JavaScript
var dataItem = {
"Date": "2016-12-31",
"Id": "1234-csj4-sadf-random",
"Scenario": "abc",
"IsFixed": "No"
};
var bugActionFormWindow = $("#actionFormWindow")
.kendoWindow({
title: "Please confirm the details",
visible: false,
modal: true,
actions: ["Maximize", "Close"],
width: "700px",
height: "500px",
iframe: true
}).data("kendoWindow");
bugActionFormWindow.refresh({
url: "/bugTriage/triageform",
data: dataItem,
dataType: "json"
});
bugActionFormWindow.center().open();
Controller.cs
public ActionResult TriageForm(BugViewModel vm) {
return this.View(vm);
}
BugViewModel.cs
public class BugViewModel{
public string Date {get; set;}
public string Id {get; set;}
public string Scenario {get; set;}
public string IsFixed {get; set;}
}
The data in the controller is null. Please suggest if I am doing anything wrong. Also I am unaware how can I get the updated data in the `Home` view. Kendo Window refresh documentation says it "Returns the window object to support chaining". But I can't understand how to get the return value.
1. posting data in a kendo Window. The kendo Window will contain a form. (I am trying to achieve this using iframe.)
2. and retrieving back the updated data from the form.
Home.cshtml
<div id="actionFormWindow"></div>
TriageForm.cshtml
@model BugViewModel
<form>
//display the model data
</form>
<button class="k-button" id="okButton">Ok</button>
<button class="k-button" id="cancelButton">Cancel</button>
JavaScript
var dataItem = {
"Date": "2016-12-31",
"Id": "1234-csj4-sadf-random",
"Scenario": "abc",
"IsFixed": "No"
};
var bugActionFormWindow = $("#actionFormWindow")
.kendoWindow({
title: "Please confirm the details",
visible: false,
modal: true,
actions: ["Maximize", "Close"],
width: "700px",
height: "500px",
iframe: true
}).data("kendoWindow");
bugActionFormWindow.refresh({
url: "/bugTriage/triageform",
data: dataItem,
dataType: "json"
});
bugActionFormWindow.center().open();
Controller.cs
public ActionResult TriageForm(BugViewModel vm) {
return this.View(vm);
}
BugViewModel.cs
public class BugViewModel{
public string Date {get; set;}
public string Id {get; set;}
public string Scenario {get; set;}
public string IsFixed {get; set;}
}
The data in the controller is null. Please suggest if I am doing anything wrong. Also I am unaware how can I get the updated data in the `Home` view. Kendo Window refresh documentation says it "Returns the window object to support chaining". But I can't understand how to get the return value.