KanbanFeatures.cshtml
@(Html.EJ().Kanban("Kanban")
……………
.ClientSideEvents(eve => eve.ActionComplete("complete"))
)
<script>
function complete(args) {
var kObj = $("#Kanban").data("ejKanban");
if ((args.requestType == "beginedit" || args.requestType == "add") && args.model.editSettings.editMode == "dialogtemplate") {
……………………
$("#" + kObj._id + "_dialogEdit").ejDialog({ open: "open" }) // Dialog open event
}
}
function open(args) { // Called when dialog form was opened using dialog open event
var kObj = $("#Kanban").data("ejKanban");
var $dialogWrapper = kObj.element.find("#" + kObj._id + "_dialogEdit_wrapper"); // Get dialog wrapper
$dialogWrapper.css("top", "100px"); // Set Top of dialog form
$dialogWrapper.css("left", "100px"); // Set bottom of dialog form
}
</script> |
KanbanFeatures.cshtml
@(Html.EJ().Kanban("Kanban")
…………
.ClientSideEvents(eve => eve.CardDragStart("cardDragStart")) // Card drag start event
)
<script>
function cardDragStart(args) {
var primaryKey = args.model.fields.primaryKey; // Get primarykey of kanban
if (args.data[0][0][primaryKey] == 1) { // If primary key of card is 1 then prevent drag and drop operation
args.cancel = true; // Set cancel as true
args.draggedElement.removeClass('e-kanban-draggedcard'); // removed Kanban dragged card class
if (args.draggedElement.next().hasClass('e-targetdragclone'))
args.draggedElement.next().remove(); // target drag clone was rmoved
}
}
</script> |
Thanks, the solution really work well.