Hi SongKang,
By default, the nodes are added into lanes not phases. So, if you need to get a phase object based on the dropped node in lane, then you can check the below highlighted condition to get an phase object in drop event.
Code example:
$("#diagram").ejDiagram({
drop: function drop(args) {
var phase = getPhase(args.element, args.model);
},
});
function getPhase(element,model) {
var diagram = $("#diagram").ejDiagram("instance");
if (element && element.type !== "connector") {
var nodebounds = ej.datavisualization.Diagram.Util.bounds(element);
var swimlaneCollection = model.nodes[0];
if (swimlaneCollection.isSwimlane) {
var swimlaneObject = diagram.getNode(swimlaneCollection.name);
for (var i = 0; i < swimlaneObject.phases.length; i++) {
var phase = swimlaneObject.phases[i];
if (nodebounds.x + nodebounds.width > phase.offset) {
//return an phase object
return phase;
}
}
}
}
}
Also, could you please confirm us whether you need to get all nodes which falls under an phase. If so, please let me know whether you need this requirement at initial rendering(button click) or at runtime(drop or any other event). So that we can provide a solution based on it.
Regards,
Shyam G