. . . . .
public rowDrop(args) {
var proxy = (document.getElementById("Grid") as any).ej2_instances[0];
if (this.flag_fg) {
this.IterateGridRDD(args, "Grid", proxy);
this.flag_fg = !this.flag_fg;
}
}
public secondRowDrop(args) {
var proxy = (document.getElementById("DestGrid") as any).ej2_instances[0];
if (this.flag_sg) {
this.IterateGridRDD(args, "DestGrid", proxy);
this.flag_sg = !this.flag_sg;
}
}
IterateGridRDD(args, targetGrid, gridObj) {
var destGrid = null;
var targetId = "";
if (!args.target.closest(".e-grid")) {
return;
}
targetGrid = args.target.closest(".e-grid").id;
let gridSearch = parentsUntil(args.target, targetGrid, true);
let gridInstances = {
Grid: (document.getElementById("Grid") as any).ej2_instances[0],
DestGrid: (document.getElementById("DestGrid") as any).ej2_instances[0]
};
destGrid = gridInstances[targetGrid];
targetId = targetGrid;
if (gridObj.element.id === targetGrid) {
return;
}
if (destGrid) {
const origGrid = gridObj;
origGrid.rowDropSettings.targetID = targetId;
for (var i = 0; i < args.data.length; i++) {
origGrid.deleteRecord("OrderID", args.data[i]);
destGrid.addRecord(args.data[i], destGrid.currentViewData.length);
}
args.cancel = true;
destGrid.trigger("rowDrop", args);
}
} |