I'm failing somewhere in my load of a TreeList. I added a simple error handler like this:
<
script
id
=
"icon-template"
type
=
"text/x-kendo-template"
>
<
div
class
=
'group-photo'
style
=
'background-image: url(@Url.Content("~/images/32/neighbourhood.png"));'
></
div
>
<
div
class
=
'group-name'
>#: Name #</
div
>
</
script
>
<
div
class
=
"demo-section k-content"
>
<
h4
>Customer Groups</
h4
>
@(Html.Kendo().TreeList<
GsiPortal.Models.Group
>()
.Name("treelist")
.Columns(columns =>
{
columns.Add().Field(e => e.Name).Width(220).TemplateId("icon-template");
columns.Add().Field(e => e.Description);
columns.Add().Field(e => e.AddTimestamp).Width(220).Title("Timestamp").Format("{0:MMMM d, yyyy}");
columns.Add().Command(c => { c.CreateChild().Text("Add"); }).HtmlAttributes(new {style = "text-align: center;"});
columns.Add().Command(c => { c.Edit(); }).HtmlAttributes(new { style = "text-align: center;" });
columns.Add().Command(c => { c.Destroy(); }).HtmlAttributes(new { style = "text-align: center;" });
})
.Editable(e => e.Mode(TreeListEditMode.PopUp).TemplateName("GroupEdit"))
.Selectable(selectable => selectable.Mode(TreeListSelectionMode.Single))
.DataSource(dataSource => dataSource
.ServerOperation(false)
.Create(create => create.Action("CreateJson", "Groups"))
.Read(read => read.Action("AllJson", "Groups")
.Data("groupsRead"))
.Update(update => update.Action("UpdateJson", "Groups"))
.Destroy(delete => delete.Action("DestroyJson", "Groups"))
.Model(m =>
{
m.Id(f => f.Id);
m.ParentId(f => f.ParentId);
m.Expanded(true);
m.Field(f => f.Name);
m.Field(f => f.Description);
m.Field(f => f.AddTimestamp).Editable(false);
})
.Events(x => x.Error("onError"))
))
<
script
>
var groupId = Number(@(ViewBag.GroupId));
function groupsRead() {
return { id: groupId };
}
function onError(e) {
alert(e.toString());
}
</
script
>
However, this doesn't give me any clue as to what object type is there to pull the message from. What is the recommended way of doing Error Handling with this control that will give me some actionable information?
Thanks, Joel