http://jsfiddle.net/OnaBai/5x8wt0f7/
What am I supposed to do if my data is
data: [
{ proccess: "p1", estatus: 1, ob:{comment: "c1"} },
{ proccess: "p2", status: 2, ob:{comment: "c1"} },
{ proccess: "p3", status: 3, ob:{comment: "c1"} },
],
wanted to get the same result as in fiddler
When doing Update/Create/Destory operations, two operations get posted to the controller:
First Create operation then a Destroy/Update/Create.
And the ModelState is invalid always.
I have code:
Client side grid:
<script>
$(document).ready(function () {
var crudServiceBaseUrl = "",
dataSource = new kendo.data.DataSource({
transport: {
read: {
url: crudServiceBaseUrl + "/Users/Read",
dataType: "json"
},
update: {
url: crudServiceBaseUrl + "/Users/Edit",
type: "POST",
dataType: "json"
},
destroy: {
url: crudServiceBaseUrl + "/Users/Destroy",
type: "POST",
dataType: "json"
},
create: {
url: crudServiceBaseUrl + "/Users/Create",
type: "POST",
dataType: "json"
},
parameterMap: function (options, operation) {
if (operation !== "read" && options.models) {
return { models: kendo.stringify(options.models) };
}
}
},
batch: true,
pageSize: 20,
schema: {
data: "Data",
model: {
id: "ID",
fields: {
ID: { type: "number" },
FirstName: { type: "string" },
LastName: { type: "string" },
Email: { type: "string" },
Password: { type: "string" }
}
}
}
});
$("#grid").kendoGrid({
dataSource: dataSource,
pageable: true,
height: 550,
toolbar: ["create"],
columns: [
{ field: "FirstName", title: "First Name" },
{ field: "LastName", title: "Last Name" },
{ field: "Email", title: "Email" },
{ field: "Password", title: "Password" },
{ command: ["edit", "destroy"], title: " ", width: "250px" }],
editable: "inline"
});
});
</script>
Controller:
public ActionResult Read([DataSourceRequest] DataSourceRequest request)
{
var users = db.Users.Select<DAL.User, UserViewModel>(u => new UserViewModel
{
ID = u.ID,
FirstName = u.FirstName,
LastName = u.LastName,
Email = u.Email,
Password = u.Password
});
return this.Json(users.ToDataSourceResult(request), JsonRequestBehavior.AllowGet);
}
[AcceptVerbs(HttpVerbs.Post)]
public ActionResult Edit([DataSourceRequest] DataSourceRequest request, UserViewModel user)
{
if (user != null && ModelState.IsValid)
{
var userToUpdate = db.Users.FirstOrDefault<DAL.User>(u => u.ID == user.ID);
if (userToUpdate != null)
{
userToUpdate.FirstName = user.FirstName;
userToUpdate.LastName = user.LastName;
userToUpdate.Email = user.Email;
userToUpdate.Password = user.Password;
db.SaveChanges();
}
}
return Json(new[] { user }.ToDataSourceResult(request, ModelState));
}
[AcceptVerbs(HttpVerbs.Post)]
public ActionResult Create([DataSourceRequest] DataSourceRequest request, UserViewModel user)
{
if (user != null && ModelState.IsValid)
{
var userToCreate = new DAL.User();
userToCreate.FirstName = user.FirstName;
userToCreate.LastName = user.LastName;
userToCreate.Email = user.Email;
userToCreate.Password = user.Password;
db.Users.Add(userToCreate);
db.SaveChanges();
}
return Json(new[] { user }.ToDataSourceResult(request, ModelState));
}
[AcceptVerbs(HttpVerbs.Post)]
public ActionResult Destroy([DataSourceRequest] DataSourceRequest request, UserViewModel user)
{
if (user != null && ModelState.IsValid)
{
var userToDelete = db.Users.FirstOrDefault<DAL.User>(u => u.ID == user.ID);
if (userToDelete != null)
db.Users.Remove(userToDelete);
db.SaveChanges();
}
return Json(new[] { user }.ToDataSourceResult(request, ModelState));
}
// GET: Users
public ActionResult Index()
{
return View();
}
Is it possible to set the theme on a grid without changing the entire css? For example I can have several graphs all on the same page with different themes, that can be set dynamically. Is there a way to set the theme on an instance of a grid like you can with graphs?
Thanks

I'm trying to use a custom footer in the KendoUI DatePicker, I'm able to do this, however it's always wrapped in the today link. For example:
<a href="#" class="k-link k-nav-today" title="Monday, April 13, 2015"> ... My Custom Footer Code ...</a>Is there a way to prevent my footer code from being wrapped in the link?
Incorrect visualization, how can I fix it?
http://dojo.telerik.com/ejUrO
Thanks for the help
I have two separate scenarios. In both scenarios the treeview is 2 levels deep.
Level 1A
-Level 2a
-Level 2b
Leve l 1B
I have hacked together some jquery but it is ugly and I was wondering if there is an efficient way to in one case limit selections to top (parent) level nodes (Level 1A, Level 1B) and in the other case limit selections to child level nodes (Level 2a, Level 2b). Maybe someway in the template to add a class to child level nodes or something of that sorts?