Hi,
I am using the latest build of Kendo UI (2012.2 913) and I am trying to display a "success" message after a user creates a new record using popup template.
Currently I am returning a JSON Object once the insert is completed as:
public ActionResult GalleryCreate([DataSourceRequest]
DataSourceRequest request, UserCreateModel model) // decorated with DataSourceRequestAttribute
{
if (null != model && ModelState.IsValid)
{
service.CreateUser(model);
var json = new
{
success = true,
successMessage ="Successfully added a new User!"
};
return Json(json);
}
}
--->
in my razor page, I am binding to the requestEnd function:
$(document).ready(function () {
var grid = $("#userGrid").data("kendoGrid").dataSource;
grid.bind("requestEnd", function (e) {
if (e.type == "create") {
alert(e.successMessage);
}
});
});
--> The event is firing, but I am not sure how to get my hands on the JSON object to display a "success message"?
Thanks!
I am using the latest build of Kendo UI (2012.2 913) and I am trying to display a "success" message after a user creates a new record using popup template.
Currently I am returning a JSON Object once the insert is completed as:
public ActionResult GalleryCreate([DataSourceRequest]
DataSourceRequest request, UserCreateModel model) // decorated with DataSourceRequestAttribute
{
if (null != model && ModelState.IsValid)
{
service.CreateUser(model);
var json = new
{
success = true,
successMessage ="Successfully added a new User!"
};
return Json(json);
}
}
--->
in my razor page, I am binding to the requestEnd function:
$(document).ready(function () {
var grid = $("#userGrid").data("kendoGrid").dataSource;
grid.bind("requestEnd", function (e) {
if (e.type == "create") {
alert(e.successMessage);
}
});
});
--> The event is firing, but I am not sure how to get my hands on the JSON object to display a "success message"?
Thanks!