<ejs-dialog #template [height]='height' [visible]='false' [animationSettings]='animationSettings' [showCloseIcon]='showCloseIcon' [content]='alertContent' [header]='alertHeader' isModel='true' [width]='width'>
<ng-template #footerTemplate>
<input id="inVal" class="e-input" type="text" placeholder="Enter Status"/>
<button id="sendButton" (click)="status($event)" class="e-control e-btn e-primary sendButton" data-ripple="true">Send</button>
</ng-template>
</ejs-dialog>
<ejs-grid #batchgrid id='Batchgrid' [dataSource]='data' allowPaging='true' [pageSettings]='pageSettings' [editSettings]='editSettings' (cellEdit)='cellEdit($event)' [toolbar]='toolbar'>
<e-columns>
<e-column field='OrderID' headerText='Order ID' width='120' textAlign='Right' isPrimaryKey='true' [validationRules]='orderidrules'></e-column>
. . . . .
<e-column field='OrderDate' headerText='Order Date' width='130' format='yMd' editType='datepickeredit' textAlign='Right'></e-column>
<e-column field='Status' headerText='Status' width='150' displayAsCheckBox='true' ></e-column>
</e-columns>
</ejs-grid>
|
cellEdit(args){
this.rowindex = args.row.rowIndex;
args.cancel = true;
this.Dialog.element.getElementsByTagName('input')[0].value = args.rowData['Status']
this.Dialog.show();
}
status(args){
// you can update value as per your requirement.
if(this.Dialog.element.getElementsByTagName('input')[0].value =="false"){
this.grid.editModule.updateCell(this.rowindex, "Status", false)
this.grid.editModule.updateCell(this.rowindex, "OrderDate", new Date())
}
this.Dialog.hide();
} |
import { Component, OnInit, ViewChild } from '@angular/core';
import { DialogComponent } from '@syncfusion/ej2-angular-popups';
export class BatchEditComponent implements OnInit {
@ViewChild('dialog')
public Dialog: DialogComponent;
@ViewChild('batchgrid')
cellEdit(args){
this.rowindex = args.row.rowIndex;
args.cancel = true;
this.Dialog.element.getElementsByTagName('input')[0].value = args.rowData['Status']
this.Dialog.show();
}
}
|
cellEdit(args: any){
this.dialogcustomization(args)
}
dialogcustomization(args: any){
this.rowindex = args.row.rowIndex;
args.cancel = true;
this.Dialog.element.getElementsByTagName('input')[0].value = args.rowData['Status']
this.Dialog.show();
}
|