|
KanbanFeatures.cshtml
@(Html.EJ().Kanban("Kanban")
.ClientSideEvents(eve => eve.QueryCellInfo("queryCellInfo")) // Query cell info event
)
<script>
function queryCellInfo(args) { // Triggered when every single card rendered
$($(args.card).find(".e-primarykey")).html("<a class='cursor' onclick='myFunction(this)'>" + args.data.Id + "</a>"); // Change card title into anchor tag with click event
}
function myFunction(args) { // Triggered when card anchor tag clicked
var kanbanObj = $("#Kanban").data("ejKanban");
kanbanObj.KanbanEdit.startEdit(parseInt($(args).html())); // StartEdit public method was used for dialog form open
}
</script>
<style>
.cursor {
cursor: pointer;
}
</style> |
|
KanbanFeatures.cshtml
@(Html.EJ().Kanban("Kanban")
.CardSettings(card =>
{
card.Template("#cardtemplate"); // Card template
})
)
<script id="cardtemplate" type="text/x-jsrender"> // Here, customize the Kanban cards
<table class="e-templatetable">
<colgroup>
<col width="10%">
<col width="90%">
</colgroup>
<tbody>
<tr>
<td class="photo">
<img src="../content/images/kanban/{{:Priority}}.png">
</td>
<td class="details">
<table>
<colgroup>
<col width="10%">
<col width="90%">
</colgroup>
<tbody>
<tr>
<td class="CardHeader"> CardId: </td>
<td><a class="cursor" onclick='myFunction(this)'>{{:Id}}</a></td> // Anchor tag with click event
</tr>
<tr>
<td class="CardHeader"> Assignee: </td>
<td>{{:Assignee}}</td>
</tr>
<tr>
<td class="CardHeader"> Summary: </td>
<td>{{:Summary}}</td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
</script>
<script>
function myFunction(args) { // Triggered when card anchor tag clicked
var kanbanObj = $("#Kanban").data("ejKanban");
kanbanObj.KanbanEdit.startEdit(parseInt($(args).html())); // StartEdit public method was used for dialog form open
}
</script>
<style>
.cursor {
cursor: pointer;
}
</style> |
|
KanbanFeature.cshtml
@(Html.EJ().Kanban("Kanban")
.ContextMenuSettings(menu => menu.Enable(true))
) |