Maximize productivity with
30% off* for a limited time
using BOOSTDEV30.
Includes 3- and 5-packs.
*Some exclusions may apply.New Product LaunchBoldDesk: Help desk ticketing software starts at $10 for 3 agents.
Try it for free.
rowDragStart(args){
this.flag_fg=true;
}
rowDrop(args){
if(this.flag_fg){
this.IterateGridRDD(args,"Grid",this.grid);
this.flag_fg = !this.flag_fg;
}
}
. . . . .
IterateGridRDD(args,targetGrid,gridObj){
let targetId = "";
if(!args.target.closest(".e-grid")){
return
}
targetGrid = args.target.closest(".e-grid").id;
let gridSearch = parentsUntil(args.target, targetGrid, true);
let gridInstances:Object ={Grid:this.grid,DestGrid: this.DestGrid,DestGrid2:this.DestGrid2};
let destGrid = gridInstances[targetGrid];
targetId = targetGrid;
if( gridObj.element.id === targetGrid){return;}
if (destGrid) {
const origGrid = gridObj;
origGrid.rowDropSettings.targetID = targetId;
origGrid.notify('rows-removed', { records: args.data }); // remove from source grid
origGrid.notify('model-changed', {
type: 'actionComplete', requestType: 'rowdraganddrop',
});
destGrid.trigger('rowDrop', args);
destGrid.notify('rows-added', { records: args.data });
destGrid.notify('model-changed', {
type: 'actionBegin', requestType: 'rowdraganddrop', // added to destination grid
});
}
args["cancel"]=true;
}
}
|
rowDrop(args) {
var rowElement = parentsUntil(args.target, 'e-row') // get corresponding drop row element
args.data['ShipCountry'] = this.grid.getCurrentViewRecords()[parseInt(rowElement.getAttribute('aria-rowindex'))]['ShipCountry'] // change the row drag data value based on the drop value
this.grid.editModule.updateRow(args.fromIndex, args.data); // and then update the data
}
|
[app.component.ts]
mouseover(args) {
if (this.flag && this.destGrid.currentViewData.length > 0) {
let row = this.destGrid.element.querySelectorAll('.e-dragborder');
for (let i = 0; i < row.length; i++) {
row[i].classList.remove('e-dragborder');
}
var elem = args.target.classList.contains('e-rowcell') ? args.target.parentElement : parentsUntil(args.target as any, 'e-row');
if (elem && parseInt(elem.getAttribute('aria-rowindex')) >= 0) {
for (let i = 0; i < elem.childNodes.length; i++) {
elem.childNodes[i].classList.add('e-dragborder');
}
}
}
}
|