Hello,
I have a grid like the one from your demo: http://demos.telerik.com/kendo-ui/grid/hierarchy
<div>
@{
Html.Kendo().Grid<TicketModel>()
.Name("ticketsList")
.HtmlAttributes(new { @class = "ticketsGrid" })
.Columns(columns =>
{
columns.Bound(m => m.TicketID).Visible(false);
columns.Bound(m => m.TicketNumber);
columns.Bound(m => m.TicketTypeName);
columns.Bound(m => m.Name);
columns.Bound(m => m.Status);
columns.Bound(m => m.Severity);
columns.Bound(m => m.DaysOpened);
columns.Bound(m => m.DateCreated).ClientTemplate("#= kendo.format('{0:d}', kendo.parseDate(DateCreated))#");
columns.Bound(m => m.TicketNumber).ClientTemplate("<img title='Add comment' src='" + Url.Content("~/Images/icon_edit.png") + "' onclick=\"location.href='" + Url.Action("AddTicket", "Support", new { ticketId = "#= TicketID #" }) + "'\"/> ").Title("").Sortable(false).HtmlAttributes(new { @class = "action-buttons" });
})
.....
}
</div>
<script id="template" type="text/kendo-tmpl">
@(Html.Kendo().Grid<ActionModel>()
.Name("ticketsList_#=TicketID#")
.Columns(columns =>
{
columns.Bound(o => o.ActionID);
columns.Bound(o => o.Description);
columns.Bound(o => o.Name);
columns.Bound(o => o.Status);
columns.Bound(o => o.AttachmentId).ClientTemplate(
"# if (o.AttachmentId != null) { #" +
"<img title='Download Attachment' src='" + Url.Content("~/Images/Attach.png") + "' onclick=\"location.href='" + Url.Action("AddTicket", "Support", new { ticketId = "#= o.AttachmentId #" }) + "'/>" +
"# } #").Title("").Sortable(false).HtmlAttributes(new { @class = "action-buttons" });
})
......
)
</script>
The conditional from the 2nd grid is not working.. if I use the following condition "# if (AttachmentId != null) { #" i get a javascript error in page that AttachmentId is not defined.
Could you help me please with this one?
Thank you,
Oana
I have a grid like the one from your demo: http://demos.telerik.com/kendo-ui/grid/hierarchy
<div>
@{
Html.Kendo().Grid<TicketModel>()
.Name("ticketsList")
.HtmlAttributes(new { @class = "ticketsGrid" })
.Columns(columns =>
{
columns.Bound(m => m.TicketID).Visible(false);
columns.Bound(m => m.TicketNumber);
columns.Bound(m => m.TicketTypeName);
columns.Bound(m => m.Name);
columns.Bound(m => m.Status);
columns.Bound(m => m.Severity);
columns.Bound(m => m.DaysOpened);
columns.Bound(m => m.DateCreated).ClientTemplate("#= kendo.format('{0:d}', kendo.parseDate(DateCreated))#");
columns.Bound(m => m.TicketNumber).ClientTemplate("<img title='Add comment' src='" + Url.Content("~/Images/icon_edit.png") + "' onclick=\"location.href='" + Url.Action("AddTicket", "Support", new { ticketId = "#= TicketID #" }) + "'\"/> ").Title("").Sortable(false).HtmlAttributes(new { @class = "action-buttons" });
})
.....
}
</div>
<script id="template" type="text/kendo-tmpl">
@(Html.Kendo().Grid<ActionModel>()
.Name("ticketsList_#=TicketID#")
.Columns(columns =>
{
columns.Bound(o => o.ActionID);
columns.Bound(o => o.Description);
columns.Bound(o => o.Name);
columns.Bound(o => o.Status);
columns.Bound(o => o.AttachmentId).ClientTemplate(
"# if (o.AttachmentId != null) { #" +
"<img title='Download Attachment' src='" + Url.Content("~/Images/Attach.png") + "' onclick=\"location.href='" + Url.Action("AddTicket", "Support", new { ticketId = "#= o.AttachmentId #" }) + "'/>" +
"# } #").Title("").Sortable(false).HtmlAttributes(new { @class = "action-buttons" });
})
......
)
</script>
The conditional from the 2nd grid is not working.. if I use the following condition "# if (AttachmentId != null) { #" i get a javascript error in page that AttachmentId is not defined.
Could you help me please with this one?
Thank you,
Oana