<ejs-grid #batchgrid id='Batchgrid' [dataSource]='data' allowPaging='true' [allowRowDragAndDrop]='true' [pageSettings]='pageSettings' (cellSave)="cellSave($event)" [editSettings]='editSettings' [toolbar]='toolbar'>
<e-columns>
<e-column field='OrderID' headerText='Order ID' width='120' textAlign='Right' isPrimaryKey='true' [validationRules]='orderidrules'></e-column>
</e-columns>
</ejs-grid>
|
cellSave(args){
let tr = parentsUntil(args.cell, "e-row");
let cell = this.Grid.getRowObjectFromUID(tr.getAttribute('data-uid')).cells;
if(this.Grid.columns.length < cell.length){
this.Grid.getRowObjectFromUID(tr.getAttribute('data-uid')).cells = this.Grid.getRowObjectFromUID(tr.getAttribute('data-uid')).cells.slice(1);
}
}
|
Hi Kishore,
Greetings from Syncfusion support.
As per your suggestion, we have created a sample and resolve batch editing problem in Grid. Please check the below code example and sample for more information.
<ejs-grid #batchgrid id='Batchgrid' [dataSource]='data' allowPaging='true' [allowRowDragAndDrop]='true' [pageSettings]='pageSettings' (cellSave)="cellSave($event)" [editSettings]='editSettings' [toolbar]='toolbar'><e-columns><e-column field='OrderID' headerText='Order ID' width='120' textAlign='Right' isPrimaryKey='true' [validationRules]='orderidrules'></e-column></e-columns></ejs-grid>
cellSave(args){let tr = parentsUntil(args.cell, "e-row");let cell = this.Grid.getRowObjectFromUID(tr.getAttribute('data-uid')).cells;if(this.Grid.columns.length < cell.length){this.Grid.getRowObjectFromUID(tr.getAttribute('data-uid')).cells = this.Grid.getRowObjectFromUID(tr.getAttribute('data-uid')).cells.slice(1);}}
We have already considered “Batch edit misbehaves when enable allow drag and drop in Grid” as a bug and logged a defect report for the same and the fix for issue will be available on 17th April 2019. You can now track the current status of your request through this link https://www.syncfusion.com/feedback/4846/batch-edit-misbehaves-when-allowdraganddrop-enabled.
Regards,Thavasianand S.
<ejs-grid #batchgrid id='Batchgrid' (actionFailure)='actionFailure($event)' [dataSource]='data' allowPaging='true' [pageSettings]='pageSettings'
[editSettings]='editSettings' [toolbar]='toolbar'>
<e-columns>
<e-column headerText='Employee Image' allowEditing='false' width='150' textAlign='Center'>
<ng-template #template let-data>
<form #form="ngForm">
<div class="form-group" style="padding-top:10px;">
<div class="e-float-input">
<input type="text" required #sname='ngModel' [(ngModel)]="data.Name" name={{data.OrderID}} maxlength="10" />
</div>
<div *ngIf="sname.invalid && (sname.dirty || sname.touched)" class="alert alert-danger">
<div *ngIf="sname.errors.required">
Name is required.
</div>
</div>
</div>
</form>
</ng-template>
</e-column>
<e-column field='OrderID' headerText='Order ID' width='120' textAlign='Right' isPrimaryKey='true' [validationRules]='orderidrules'></e-column>
</e-columns>
</ejs-grid>
|