Hi,
I currently am using the MVC wrapper extensions to create a TreeView from my models. I would like to pass some data from the model to the template so that I can display it alongside the text upon click.
Here is my TreeView:
Thanks for any help,
Jeff
I currently am using the MVC wrapper extensions to create a TreeView from my models. I would like to pass some data from the model to the template so that I can display it alongside the text upon click.
Here is my TreeView:
@(Html.Kendo().TreeView()
.Name(
"s-list-event-container"
)
.HtmlAttributes(
new
{ @
class
=
"s-list-container"
, style =
"color: white"
})
.Events(events => events
.Select(
"preventSelect"
)
)
.TemplateId(
"template-list-event"
)
.BindTo(Model.ToList(), mapping => mapping
.For<ArdentMC.Sentry.Data.Event>(binding => binding
.Children(e => e.EventObjects)
.ItemDataBound((item, e) =>
{
item.Id = e.EventID.ToString();
item.Text = e.Name;
// Here's where I'd like to add a description. The line below runs but appears to do nothing.
item.HtmlAttributes.Add(
"data-description"
, e.Description);
})
)
.For<ArdentMC.Sentry.Data.EventObject>(binding => binding
.Children(o => o.EventObjects)
.ItemDataBound((item, o) =>
{
item.Id = o.EventObjectID.ToString();
item.Text = o.Name;
})
)
)
)
Jeff